FormsAuthentication.SignOut not working

Discussion in 'ASP .Net Security' 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,762
    tharadk
    Jul 24, 2009
  2. Ed West
    Replies:
    0
    Views:
    384
    Ed West
    Aug 23, 2004
  3. Matthias S.
    Replies:
    3
    Views:
    4,073
  4. Patrick Olurotimi Ige

    FormsAuthentication.SignOut() not working in UserControl

    Patrick Olurotimi Ige, Jul 6, 2005, in forum: ASP .Net
    Replies:
    9
    Views:
    1,520
    Patrick.O.Ige
    Jul 8, 2005
  5. parez
    Replies:
    2
    Views:
    662
    parez
    Nov 16, 2006
Loading...

Share This Page