Cookie problem - getting double rather than updating

G

Guest

I have a cookie that is set by a previous ASP page that I wish to update with
the following logic.

MyCookieColl = Request.Cookies;

for (loop1 = 0; loop1 < MyCookieColl.Count ; loop1++) {
MyCookie = MyCookieColl[loop1];
if (MyCookie.Name == "AspenUser") {
MyCookie["TimeZonePK"] = ddTZ.SelectedValue;
MyCookie["Timezone"] = ddTZ.SelectedItem.Text;
Response.Cookies.Set (MyCookie);
}
}

The result of this is two cookies with the same name. The first cookie
retains the original values with the second cookie have the updated values.
I have tried about every code appraoch I could think of. The cookies do not
have Expires. After the above code, I interate thought the Response cookie
object and output the values. There appears to be no cookie with the old
value, but there it is on the next page load along with the new values.

It appears that if I create the cookie on this page and then update it, the
change takes affect correctly. It is only when working witht eh cookie
previously created.


Any help would be appreciated.

Bob Storrs
(e-mail address removed)
 

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


Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top