Re: Can't get FormsAuthentication.SignOut to work... ??

From: Greg Burns (greg_burns_at_DONT_SPAM_ME_hotmail.com)
Date: 09/19/04


Date: Sun, 19 Sep 2004 10:21:25 -0400

When you say they are still signed in, do you mean
User.Identity.IsAuthenticated = true?. Or that they still have session
variables?

FormsAuthentication.SignOut() will not clear session variables...

Just a thought,
Greg

"Ed West" <west@westville.com> wrote in message
news:u4C9UrhnEHA.592@TK2MSFTNGP11.phx.gbl...
> 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 ));
>
>
>
>



Relevant Pages

  • Cant get FormsAuthentication.SignOut to work... ??
    ... redirects to default.aspx. ... This is how I logged users on: ... FormsAuthenticationTicket authTicket = new ... HttpCookie authCookie = new HttpCookie( ...
    (microsoft.public.dotnet.framework.aspnet)
  • FormsAuthentication.SignOut not working
    ... redirects to default.aspx. ... This is how I logged users on: ... FormsAuthenticationTicket authTicket = new ... HttpCookie authCookie = new HttpCookie( ...
    (microsoft.public.dotnet.framework.aspnet)
  • FormsAuthentication.SignOut not working
    ... redirects to default.aspx. ... This is how I logged users on: ... FormsAuthenticationTicket authTicket = new ... HttpCookie authCookie = new HttpCookie( ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Question about redirecting to a "session expired" page...
    ... FormsAuthenticationTicket authTicket = ... // auth ticket probably didn't exist which means this is NOT a session ... The problem is I don't know how to test the AuthCookie for ... >> happens automatically when the AuthCookie expires. ...
    (microsoft.public.dotnet.framework.aspnet.security)