Hi mates
I am having a problem with my Cookie recipe.
I can't seem to be able to create my cookie. Please have a look and see if i am missing something.
Here is the code that i use to create my cookie.
Dim ClientCookie As HttpCookie
Dim CookieName As String = CType(Current_Page, Base_Page).Local_Server.Client_System_Name
Dim CreatedCookie As Boolean = False
Variable_Name = Variable_Name.ToUpper
ClientCookie = Current_Page.Request.Cookies(CookieName)
If IsNothing(ClientCookie) Then
ClientCookie = New HttpCookie(CookieName)
CreatedCookie = True
ClientCookie.Domain = CookieName
ClientCookie.Expires = Now.AddDays(14)
End If
ClientCookie.Values.Remove(Variable_Name)
ClientCookie.Values.Add(Variable_Name, Value)
If CreatedCookie Then
Current_Page.Response.AppendCookie(ClientCookie)
Else
Current_Page.Response.Cookies.Add(ClientCookie)
End If
Here is the code that i use to read my cookie.
Dim ClientCookie As HttpCookie
Variable_Name = Variable_Name.ToUpper
Dim CookieName As String = CType(Current_Page, Base_Page).Local_Server.Client_System_Name
ClientCookie = Current_Page.Request.Cookies(CookieName)
If IsNothing(ClientCookie) Then
Return Nothing
Else
Return ClientCookie.Values(Variable_Name)
End If
Can anybody see something wrong?