KnotGoblin
Technical User
I am having trouble retreiving a cookie (or setting for that matter).
I am using the following to retreive the cookie on page_load
here is the code that sets the cookie.
If i view the cookie in firefox, the cookies has no attributes.
And for IE the cookie never shows up.
-Jer
I am using the following to retreive the cookie on page_load
Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not Request.Cookies("pref1") Is Nothing Then
Trace.Write("cookie value = " & Request.Cookies("pref1").Value)
Else
Trace.Write("cookie doesn't exist")
End If
End Sub
here is the code that sets the cookie.
Code:
Private Sub savePref(ByVal pref1 as Integer)
Dim myCookie As New HttpCookie("pref1")
myCookie.Value = pref1
myCookie.Expires = DateTime.MaxValue
Response.Cookies.Add(myCookie)
End Sub
If i view the cookie in firefox, the cookies has no attributes.
And for IE the cookie never shows up.
-Jer