I'm trying to sign out a user when a session object don't exist with following code in my View:
FormsAuthentication.SignOut();
But this doesn't work - the user is already authenticated.
I've seen that the default LogOff Controller Action use this code to signout a user:
AuthenticationManager.SignOut();
But I can't use this code in my view.
So how can I logout a user in my View? Or when it's not possible how can I do this in a Controller?
Thanks for help :)
alink.AuthenticationManager.SignOut();and on the next line haveUser.Identity.IsAuthenticated;- it will still show true.