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...
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?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With