Cookies not saving

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
 
P

Peter O'Reilly

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top