Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Apr 18, 2011 06:34 PM by AreJayEss
Apr 18, 2011 01:53 PM|LINK
At what point after a WebSecurity.Login should WebSecurity.IsAuthenticated become true?
I have a utility function that checks WebSecurity.IsAuthenticated (amongst other things). If I call that function from the Login.cshtml page (from Starter Site templte) after WebSecurity.Login has succeeded then IsAuthenticated is false. However, during
processing of the next page the function finds IsAuthenticated as true.
Is that expected behaviour?
Apr 18, 2011 04:22 PM|LINK
WebSecurity.IsAuthenticated actually returns the value of HttpRequest.IsAuthenticated, which is true if the Forms Authentication cookie has been set and is current. It's not available until the user makes the next request after successfully logging in, which
is why you are seeing the behaviour that you describe.
Apr 18, 2011 06:34 PM|LINK
Tht makes sense. Thankyou Mike.