I've wrapped some code around my project to enable user authentication. It seems to be using FormsAuthentication
as well as .NetCasAuthentication
. When a user wants to login, I redirect them to an external page whose URL is saved in
DotNetCasClient.CasAuthentication.FormsLoginUrl
, and that, after a successful login attempt, sets the User.Identity
object. So far so good.
Now, how do I properly sign the user out?
I've tried
FormsAuthentication.SignOut()
- Expiring a couple cookies as suggested here
- And even explicitly nullifying the User object:
HttpContext.Current.User = new GenericPrincipal(new GenericIdentity(string.Empty), null);
But when I send another request to my application, it's still able to find that user's information somewhere.
Does CasAuthentication save to a cookie? Or is it more likely that it's in some unique location as defined by the external login page? I have the option of redirecting to the corresponding external logout page, but I don't know how to do that without redirecting to it and leaving my application, and I don't want to do that.
Thanks for reading.