C
craigkenisston
So, I have this code : (AspNet 1.1)
FormsAuthenticationTicket authTkt = new FormsAuthenticationTicket(1,
_username,
DateTime.Now,
DateTime.Now.AddMinutes(60),
true,
userdata);
string encTicket = FormsAuthentication.Encrypt(authTkt);
HttpCookie authCookie = new
HttpCookie(FormsAuthentication.FormsCookieName, encTicket);
// authCookie.Domain = "mysite.com";
// authCookie.Path = "/";
Response.Cookies.Add(authCookie);
When I call FormsAuthentication.SignOut(); it does work.
However, since I use subdomains I have to use the commented lines
..Domain and .Path, in order to the cookie work site wide. So, I
uncomment those lines and run my sample again. Now I click the logout
button in my site, which calls formsAuthentication.SignOut, but it does
not signout ! The user still authenticated !
What's happening here ? I have no idea.
FormsAuthenticationTicket authTkt = new FormsAuthenticationTicket(1,
_username,
DateTime.Now,
DateTime.Now.AddMinutes(60),
true,
userdata);
string encTicket = FormsAuthentication.Encrypt(authTkt);
HttpCookie authCookie = new
HttpCookie(FormsAuthentication.FormsCookieName, encTicket);
// authCookie.Domain = "mysite.com";
// authCookie.Path = "/";
Response.Cookies.Add(authCookie);
When I call FormsAuthentication.SignOut(); it does work.
However, since I use subdomains I have to use the commented lines
..Domain and .Path, in order to the cookie work site wide. So, I
uncomment those lines and run my sample again. Now I click the logout
button in my site, which calls formsAuthentication.SignOut, but it does
not signout ! The user still authenticated !
What's happening here ? I have no idea.