ThatRickGuy
Programmer
Hey Guys, I've been trying to store some user options in a cookie, and I'm having nada for luck.
in my global.asax I have the following:
When my page comes up, I see the "Session Start!" message correctly. And on the Page_Load of the page in question I have the following:
It works fine on the first load, the value of the cookie is displayed, but any refresh/post back after that and the nothing is displayed.
And there is nothing in the C:\Documents And Settings\<user>\Cookies folder. (I cleared it before testing, and have been hitting refresh in explorer)
Am I missing something obvious?
-Rick
VB.Net Forum forum796 forum855 ASP.NET Forum
I believe in killer coding ninja monkeys.![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
in my global.asax I have the following:
Code:
Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
' Fires when the session is started
Response.Write("Session Start!")
Response.Cookies("Options")("Branches") = "'Madison','Milwaukee','Geneva',"
Response.Cookies("Options")("OrderField") = "First Name"
Response.Cookies("Options")("Departments") = False
Response.Cookies("Options").Expires = Now.AddDays(20)
End Sub
When my page comes up, I see the "Session Start!" message correctly. And on the Page_Load of the page in question I have the following:
Code:
Dim sBranches As String = Response.Cookies("Options")("Branches")
Response.Write(sBranches)
It works fine on the first load, the value of the cookie is displayed, but any refresh/post back after that and the nothing is displayed.
And there is nothing in the C:\Documents And Settings\<user>\Cookies folder. (I cleared it before testing, and have been hitting refresh in explorer)
Am I missing something obvious?
-Rick
VB.Net Forum forum796 forum855 ASP.NET Forum
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)
![[monkey] [monkey] [monkey]](/data/assets/smilies/monkey.gif)