Dear insomiacs, I noticed something weird.
FormsAuthenticationTicket oAuthTicket = new FormsAuthenticationTicket(1,
sUserName, DateTime.Now, DateTime.Now.AddHours(4)false, sGroups);
// Encrypt the FormsAuthenticationTicket
string sTicket = FormsAuthentication.Encrypt(oAuthTicket);
// Create the auth cookie for the User
HttpCookie oCookie = new HttpCookie(FormsAuthentication.FormsCookieName,
sTicket);
// oCookie.Expires = DateTime.Now.AddHours(4);
I noticed that when I commented out the last line above (since the
expiration is already set in the oAuthTicket creation, I no longer see the
cookie being created on my hard drive ... weird
"George Durzi" <gdurzi@nospam_hotmail.com> wrote in message
news:O3**************@tk2msftngp13.phx.gbl...
When you call FormsAuthentication.SignOut(), is the FormsAuthentication
cookie supposed to be destroyed automatically?
I'm creating my FormsAuthentication cookie by doing:
HttpCookie oCookie = new HttpCookie(FormsAuthentication.FormsCookieName,
sTicket);
where sTicket is an encrypted FormsAuthenticationTicket. When I create the
FormsAuthenticationTicket, I set its isPersistent property to false.
I set the Expires property of my cookie to now + 2 hours.
When I log out and call FormsAuthentication.SignOut(), my
FormsAuthentication cookie is still sitting there in my cookies folder,
even if I do:
Response.Cookies.Remove(FormsAuthentication.FormsC ookieName);