Cookies not saving

  • Thread starter Thread starter Mike Johnson
  • Start date Start date
M

Mike Johnson

I've copied and pasted simple code to create a cookie but it never saves the
cookie. Is there something you have to set in the web.config file to use
cookies? Here is the simple code....

Dim cook1 As New HttpCookie("MyCookie")

Dim now As DateTime = DateTime.Now

cook1.Expires = now.AddDays(30)

cook1.Values.Add("MyCookie", "Joe Bob")

Response.Cookies.Add(cook1)



Mike
 
Your code looks fine. Most likely it is a browser issue.

Have you confirmed that your web browser is accepting cookies?

Are you sure you are looking for the cookie in the right place?

Have you tried using a different browser, i.e. Netscape?
 
Back
Top