D
Daniel Jin
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 ) );
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 ) );