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