FormsAuthentication.SignOut not working

Discussion in 'ASP .Net' started by Ed West, Aug 23, 2004.

  1. Ed West

    Ed West Guest

    Hello

    This SignOut code is not working, any ideas? TIA.

    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 ));
     
    Ed West, Aug 23, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jeff Johnson
    Replies:
    6
    Views:
    3,792
    tharadk
    Jul 24, 2009
  2. Matthias S.
    Replies:
    3
    Views:
    4,135
  3. Patrick Olurotimi Ige

    FormsAuthentication.SignOut() not working in UserControl

    Patrick Olurotimi Ige, Jul 6, 2005, in forum: ASP .Net
    Replies:
    9
    Views:
    1,553
    Patrick.O.Ige
    Jul 8, 2005
  4. parez
    Replies:
    2
    Views:
    712
    parez
    Nov 16, 2006
  5. ska4reak

    formsauthentication.signout not working too good

    ska4reak, Nov 25, 2003, in forum: ASP .Net Security
    Replies:
    0
    Views:
    134
    ska4reak
    Nov 25, 2003
Loading...

Share This Page