I am using 2005 Beta 2 with the following code:
VB Code:
  1. Private Const SECURITY_COOKIE As String = "Security"
  2.     Private Const GUID_KEY As String = "GUID"
  3.  
  4.     Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  5.         Dim Cookie As HttpCookie = Request.Cookies.Item(SECURITY_COOKIE)
  6.         Dim Passed As Boolean
  7.         If Not (Cookie Is Nothing) Then
  8.             Dim GUID As String = Cookie.Item(GUID_KEY)
  9.             If GUID = String.Empty Then
  10.                 CreateSecurityCookie()
  11.             Else
  12.                 Passed = True
  13.             End If
  14.         Else
  15.             'always this line...always :o(
  16.             CreateSecurityCookie()
  17.         End If
  18.         Dim Woof As HttpCookie = Request.Cookies.Item(SECURITY_COOKIE)
  19.         If Woof Is Nothing Then
  20.             'never here as it's just been created above, so of course it exists
  21.             Passed = False
  22.         End If
  23.     End Sub
  24.  
  25.     Private Sub CreateSecurityCookie()
  26.         Dim NewCookie As New HttpCookie(SECURITY_COOKIE)
  27.         Dim dt As DateTime = DateTime.Now
  28.         Dim ds As New TimeSpan(0, 0, 20, 0)
  29.         NewCookie.Expires = dt.Add(ds)
  30.         NewCookie.Item(GUID_KEY) = "Woof"
  31.         Request.Cookies.Add(NewCookie)
  32.     End Sub
But it always hits that line of code when I refresh the page...surely 20min lifespan is long enough. The cookie is always NOTHING when I refresh the page.
How come it doesn't remember the cookie?

Am I being daft?

Woof