Can't get FormsAuthentication.SignOut to work... ??
From: Ed West (west_at_westville.com)
Date: 09/19/04
- Next message: Eliyahu Goldin: "Re: Wrap a div tag around viewstate output"
- Previous message: Steve Harris: "Re: You are about to be redirected to a connection that is not secure"
- Next in thread: Ed West: "Re: Can't get FormsAuthentication.SignOut to work... ??"
- Reply: Ed West: "Re: Can't get FormsAuthentication.SignOut to work... ??"
- Reply: Greg Burns: "Re: Can't get FormsAuthentication.SignOut to work... ??"
- Messages sorted by: [ date ] [ thread ]
Date: Sun, 19 Sep 2004 00:32:47 -0700
Hello
This SignOut code is not working, people are still logged in after it
redirects to default.aspx. any ideas? Thanks. This is really
annoying, I am ready to launch a site and this is one of the few last
things I need to figure out...
public class logout : System.Web.UI.Page {
private void Page_Load(object sender, System.EventArgs e) {
FormsAuthentication.SignOut();
// tried next line too, did not work...
Response.Cookies.Remove(FormsAuthentication.FormsCookieName);
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 ));
- Next message: Eliyahu Goldin: "Re: Wrap a div tag around viewstate output"
- Previous message: Steve Harris: "Re: You are about to be redirected to a connection that is not secure"
- Next in thread: Ed West: "Re: Can't get FormsAuthentication.SignOut to work... ??"
- Reply: Ed West: "Re: Can't get FormsAuthentication.SignOut to work... ??"
- Reply: Greg Burns: "Re: Can't get FormsAuthentication.SignOut to work... ??"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|