FormsAuthentication.SignOut not working
From: Ed West (west_at_westville.com)
Date: 09/16/04
- Next message: Steve Harris: "Re: You are about to be redirected to a connection that is not secure"
- Previous message: idstam: "Re: Impersonation, DirectoryServices"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 15 Sep 2004 22:58:03 -0700
Hello
This SignOut code is not working, people are still logged in after it
redirects to default.aspx. any ideas? Thanks.
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 ));
- Next message: Steve Harris: "Re: You are about to be redirected to a connection that is not secure"
- Previous message: idstam: "Re: Impersonation, DirectoryServices"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|