Cookies

B

Brian

I am having a problem reading cookies.

Here is the code I use to write them:
Dim cookie As New HttpCookie(CookieName)

cookie.Values.Add(ID, value)

'cookie.Expires = Date.Now.AddYears(1)

Response.Cookies.Add(cookie)

response.redirect(url)



Here is the code I use to read them:

Dim Cookie As HttpCookie = Request.Cookies(CookieName)

Dim strC As String = Cookie.Values(ID)

---------

Now everything works fine...but I un-comment that cookie.expires....that I
can't read it?????? otherwise it works?

I would like to have the cookie stay on their computer for a while...so I
know that they have been to my site before...does anyone have any
suggestions?



Brian
 

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 not persisting 2
Cookie Expiration 0
cookies question 3
Cookies during error handling 1
Asp.net 2.0 - Cookies 2
Cookie Question 1
Sessions and Cookies dont work 2

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,076
Latest member
OrderKetoBeez

Latest Threads

Top