Hello everyone.
Im developing a small web aplication, used in a shared computer.
When the user closes the browser window, i want the session and the authentication to be deleted.
In the Login page i use something like this to authenticate the user:
FormsAuthenticationTicket authTicket =
new FormsAuthenticationTicket(1,txtUser.Text,
DateTime.Now,
DateTime.Now.AddMinutes(5),
false,"");
string encTicket = FormsAuthentication.Encrypt(authTicket);
HttpCookie faCookie = new HttpCookie(FormsAuthentication.FormsCookieName, encTicket);
HttpContext.Current.Response.Cookies.Add(faCookie);
string redirectUrl = FormsAuthentication.GetRedirectUrl(txtUser.Text, false);
HttpContext.Current.Response.Redirect(redirectUrl);
As you can see, i have set the "isPersistent" variable to false.
This seems to work on Chrome (haven't tested on IE), however, when i run the app on Firefox, with multiple tabs activated, if i close the browser and open again, im still authenticated, and the cookie is still there!
Its really strange, beacause the cookie should be removed on closing... Is this a bug from Firefox, when you have multiple tabs opened? How can i fix this?
Help is much appreciated!
Thanks in advance