Cannot persist cookie
From: ed (edmundday@hotmail.com)
Date: 03/07/03
- Previous message: Adam Rakowski: "running app under custom account"
- Next in thread: yang: "Cannot persist cookie"
- Reply: yang: "Cannot persist cookie"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: edmundday@hotmail.com (ed) Date: 7 Mar 2003 09:29:02 -0800
I cannot get my cookie to persist. It always seems to have the
expiration of 1 minute from now whatever the value of
chkRememberLogin.Checked. When I look at in locals window its
expiration is in 2008 but it still seems to go.
Any ideas? Many thanks!!
Dim authTicket As FormsAuthenticationTicket
Dim strCookie As String
Dim cookAuth As HttpCookie
authTicket = New FormsAuthenticationTicket(1, txtPolicy.Text &
txtPostCode.Text, DateTime.Now(), _
DateTime.Now.AddMinutes(1), chkRememberLogin.Checked, userid)
strCookie = FormsAuthentication.Encrypt(authTicket)
cookAuth = New HttpCookie(FormsAuthentication.FormsCookieName(),
strCookie
If (chkRememberLogin.Checked) Then
cookAuth.Expires = authTicket.Expiration.AddYears(5)
Else
cookAuth.Expires = authTicket.Expiration
End If
Response.Cookies.Add(cookAuth)
- Previous message: Adam Rakowski: "running app under custom account"
- Next in thread: yang: "Cannot persist cookie"
- Reply: yang: "Cannot persist cookie"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|