News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids

Main Menu

How cookies can carry the data

Started by dhilipkumar, May 21, 2009, 07:19 PM

Previous topic - Next topic

dhilipkumar



Im searching around and found a lot of sample code but none seem to be working for me. Can someone here help?


This is what I have for writing:

' Sometimes writting the cookie, so I kill it first.
Response.Cookies("Myvar")("var1")=var1
response.cookies("Myvar").Expires=Date() -1   

' Really where I write the cookie.
Response.Cookies("Myvar")("var1")=var1
Response.Cookies("Myvar")("var2")=var2
response.cookies("Myvar").Expires=#January 1,2025#


This is what I have for reading:
var1 = Request.Cookies("Myvar")("var1")
var2 = Request.Cookies("Myvar")("var2")


var1 and var2 are always empty. When I go to view the cookied that was written, through IE Tools > Internet Options ... my cookie is simply named '[sitename]' rather than 'cookie:user@site.com'. I think this may be the reason I can't read the cookie. Now when I open the cookie in notepad, it looks correct.

thanks in advance