forms authentication cookie not timeout

From: Daniel Jin (DanielJin_at_discussions.microsoft.com)
Date: 11/29/04


Date: Mon, 29 Nov 2004 07:01:06 -0800

I customized the cookie generation in forms authentication so I can keep
extra data in the cookie. but the problem now is that my forms
authentication cookie no longer times out. anybody knows what's going on?
the following is my code that creates the cookie.

string[] roleList = <custom method to get roles>;
string userData = String.Join( ";", roleList );
                                
FormsAuthenticationTicket ticket = new FormsAuthenticationTicket(
    1, userName, issueDate, issueDate.AddMinutes(1), false, userData,
FormsAuthentication.FormsCookiePath );

string encryptedTicket = FormsAuthentication.Encrypt( ticket );

HttpCookie cookie = new HttpCookie( FormsAuthentication.FormsCookieName,
encryptedTicket );
Response.Cookies.Add( cookie );

Response.Redirect( FormsAuthentication.GetRedirectUrl( userName, false ) );



Relevant Pages

  • Re: DESPERATE: FormsAuthentication Problem
    ... I have verified that both machines are running the same version of the ... >> them in the forms authentication cookie. ... >> ' assigned a semicolon delimited string of role names. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: DESPERATE: FormsAuthentication Problem
    ... > them in the forms authentication cookie. ... > ' Get ";" delimited string of the user's roles from the database ... > Dim authTicket As FormsAuthenticationTicket = New ...
    (microsoft.public.dotnet.framework.aspnet)
  • DESPERATE: FormsAuthentication Problem
    ... them in the forms authentication cookie. ... from the forms authentication cookie, create a new FormsIdentity object, ... ' Get ";" delimited string of the user's roles from the database ... Dim authTicket As FormsAuthenticationTicket = New ...
    (microsoft.public.dotnet.framework.aspnet)
  • DESPERATE: FormsAuthentication Problem
    ... them in the forms authentication cookie. ... from the forms authentication cookie, create a new FormsIdentity object, ... ' Get ";" delimited string of the user's roles from the database ... Dim authTicket As FormsAuthenticationTicket = New ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • ASP.net Authentication question
    ... authentication cookie from the cookie collection passed ... FormsAuthenticationTicket authTicket = null; ... of role names attached to the ticket when the user was ...
    (microsoft.public.dotnet.framework.aspnet)