FormsAuthentication.SignOut not working

From: Ed West (west_at_westville.com)
Date: 09/16/04


Date: Wed, 15 Sep 2004 22:58:03 -0700

Hello

This SignOut code is not working, people are still logged in after it
redirects to default.aspx. any ideas? Thanks.

public class logout : System.Web.UI.Page {
   private void Page_Load(object sender, System.EventArgs e) {
     FormsAuthentication.SignOut();
     Response.Redirect ("default.aspx");
   }
   ....
}

This is how I logged users on:

FormsAuthenticationTicket authTicket = new
   FormsAuthenticationTicket(
         1, // version
         email.Text, // user name
         DateTime.Now, // creation
         DateTime.Now.AddMinutes(60),// Expiration
         false, // Persistent
         roles.ToString() );
string encryptedTicket = FormsAuthentication.Encrypt(authTicket);
HttpCookie authCookie = new HttpCookie(
     FormsAuthentication.FormsCookieName,encryptedTicket);
Response.Cookies.Add(authCookie);
// Redirect the user to the originally requested page
Response.Redirect( FormsAuthentication.GetRedirectUrl(
     email.Text, false ));



Relevant Pages

  • Cant get FormsAuthentication.SignOut to work... ??
    ... redirects to default.aspx. ... This is how I logged users on: ... FormsAuthenticationTicket authTicket = new ... HttpCookie authCookie = new HttpCookie( ...
    (microsoft.public.dotnet.framework.aspnet)
  • FormsAuthentication.SignOut not working
    ... redirects to default.aspx. ... This is how I logged users on: ... FormsAuthenticationTicket authTicket = new ... HttpCookie authCookie = new HttpCookie( ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Cant get FormsAuthentication.SignOut to work... ??
    ... FormsAuthentication.SignOutwill not clear session variables... ... > This is how I logged users on: ... > HttpCookie authCookie = new HttpCookie( ...
    (microsoft.public.dotnet.framework.aspnet)