Losing cookie values

D

David

Using VS2005 and ASP.Net. I am going between 2 aspx pages. I set cookies in
page 1, go to page 2 and then return to page 1 via postBackURL. When I get
back to page 1 all of the cookie values are gone and I don't do anything
with them in page 2. Any help on what might be wrong? Thanks.

David
 
D

David

I think I found the problem. The cookie was a collection of items for
example:

Response.Cookies("sqlsearch")("issue") = "0"

Response.Cookies("sqlsearch")("startdate") = "10/1/2006"

Response.Cookies("sqlsearch")("enddate") = "10/15/2006"

Response.Cookies("sqlsearch").Expires = DateTime.Now.AddDays(1)

When I tried to change just 1 "item" in the collection, I was losing the
values in the others. I was using the following to change just the enddate
item

Response.Cookies("sqlsearch")("enddate") = "10/15/2006"

Response.Cookies("sqlsearch").Expires = DateTime.Now.AddDays(1)

When I did this, I lost the other 2 values.

David
 

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