Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What sets Page.User.Identity.Name

I keep track of the current logged in userID and base the behavior of my site on this value. My code sets the logged in user ID with this statement:

FormsAuthentication.SetAuthCookie(UserID.ToString(), true);

Subsequently, I read this value from Page.User.Identity.Name.

This works fine on my desktop, but on my server, I set it to 8 and it comes back 20. I am trying to figure out what can set Page.User.Identity.Name to a value and when this happens.

Thanks...

like image 741
Bob Jones Avatar asked May 16 '26 20:05

Bob Jones


1 Answers

FormsAuthenticationModule handles Application_OnAuthenticate and assigns the HttpContext.User to a prinicipal object which is in turn used by Page.User.Identity.Name.

Isn't there a time difference issue on the server and your desktop?

like image 172
mmx Avatar answered May 19 '26 15:05

mmx