Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 838201
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T05:15:56+00:00 2026-05-15T05:15:56+00:00

I use FormsAuthentication.RedirectFromLoginPage(userName.Trim(), false); to set the User.Identity.Name field that I reference later. When

  • 0

I use FormsAuthentication.RedirectFromLoginPage(userName.Trim(), false); to set the User.Identity.Name field that I reference later. When I execute this line, the User.Identity object does not update at all; it contains whatever it was previously set to. All the documentation I see online says this should update my User.Identity object with the correct name, but I don’t see that happening.

I have the web config set up properly with the following lines:

<authentication mode="Forms">
    <forms name="formsauth" loginUrl="Login.aspx" protection="All" timeout="60">
    </forms>
</authentication>
<authorization>
    <deny users="?"/>
</authorization>

I am relatively new to this stuff, so any help is appreciated. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-15T05:15:56+00:00Added an answer on May 15, 2026 at 5:15 am

    It will be updated on the next request but not on the next line following it. RedirectFromLoginPage sets an authentication cookie in the client browser that will be read upon the next client request and you will see the User.Identity.Name property updated. Updating this property in the same HTTP request is meaningless as you already know that the user passed authentication as you called the method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

When a user log into my asp.net site I use the following code: FormsAuthentication.RedirectFromLoginPage(userid,
Using this code for authentification: HttpContext.Current.User=new GenericPrincipal (new GenericIdentity(user.UserName), roles); FormsAuthentication.SetAuthCookie(user.UserName,false); Problem is -
In my webpage i use FormsAuthentication FormsAuthentication.RedirectFromLoginPage(VisitorEmail, False) Every time the visitor gets authenticated
I 'form authenticate' users like this in the controller: FormsAuthentication.SetAuthCookie(User.Email, false); (provided that the
I can use forms authentication in ASP.NET without membership. i.e: FormsAuthentication.RedirectFromLoginPage(usuario.UsuDs, false);//usuario.UsuDS is the
This is the code that i use in login function : FormsAuthentication.SetAuthCookie(Model.IDUser, false); I'm
I have an asp.net web application that use FormsAuthentication. Now, the application has a
I am using an autocomplete extender in a site that is set to use
I have a site that uses the default SqlMembershipProvider and FormsAuthentication. I can use
i made a webpage which use FormsAuthentication. now i need to get the user

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.