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

Similar Threads

Cookies will not expire (noob question) 4
cookies wont create 3
cookies not persisting 2
No-Postback Reload Causing Duplicates :( 0
Cookies 1
Cookies 1
Cookies. Simple Question. Thank You. 1
Cookies? 0

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top