FormsAuthentication.SignOut not working

E

Ed West

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 ));
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,731
Messages
2,569,432
Members
44,835
Latest member
KetoRushACVBuy

Latest Threads

Top