Cannot persist cookie

From: ed (edmundday@hotmail.com)
Date: 03/07/03

  • Next message: Luc Kumps: "Re: How to provide Log Off for a Web Application?"
    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)


  • Next message: Luc Kumps: "Re: How to provide Log Off for a Web Application?"

    Relevant Pages

    • Cannot persist cookie
      ... >expiration is in 2008 but it still seems to go. ... >Dim authTicket As FormsAuthenticationTicket ... >Dim cookAuth As HttpCookie ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Re: Expiry of Excel shee
      ... ' expiration date. ... ' MsgBox is displayed and this workbook is closed. ... Dim ExpirationDate As String ... Change C_REG_KEY to a registry key name that ...
      (microsoft.public.excel.worksheet.functions)
    • Re: Expiry of Excel shee
      ... ' expiration date. ... ' MsgBox is displayed and this workbook is closed. ... Dim ExpirationDate As String ... Change C_REG_KEY to a registry key name that ...
      (microsoft.public.excel.worksheet.functions)
    • Re: Expiry of Excel shee
      ... ' expiration date. ... ' MsgBox is displayed and this workbook is closed. ... Dim ExpirationDate As String ... Change C_REG_KEY to a registry key name that ...
      (microsoft.public.excel.worksheet.functions)

  • Quantcast