473,385 Members | 1,942 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Cookie problem - getting double rather than updating

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
rs*****@usa.net
Nov 19 '05 #1
0 977

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: James | last post by:
Hi, I am trying to update a cookie value using the following code: Response.Cookies.Values = "VALUE"; This actually deletes the cookie rather than updating. I have set an expiry date for...
3
by: rss | last post by:
SUMMARY: ========== I am unable to pass along a simple Cookie obtained from a HttpWebRequest call (Machine A's ASP.NET app) so that another Web Server (Machine B) recongnizes the cookie. I...
15
by: Oleg Leikin | last post by:
Hi, (newbie question) I've created some simple .NET ASP application that should store cookies at the client machine. According to the documentation cookie expiration time is set via...
0
by: tshad | last post by:
I can add a cookie fine, but I can't seem to figure out how to change the value of a cookie and save it back. My code looks like: if (passwordSaveCookie.checked) then If...
1
by: Jim | last post by:
Hi, I have an Asp.Net 1.1 site which uses basic forms authentication. This has been working fine, since way back in the 1.0 days. Twice in the last 2 months, a client has been unable to log in,...
2
by: Owen | last post by:
I have a web app that is a mixture of ASP and ASP.NET pages. Largely the only data passed between them is via the querystring, or by reading from a database. However there is a requirement for...
7
by: itay_k | last post by:
Hi, I dont understand why this is so complicated, just to add one line of cookie header on the GET request. This is my unworking code: import time import Cookie import cookielib, urllib2
1
by: ticmanis | last post by:
Hello, I'm having trouble getting MSIE 6.0 (running on XP SP2) to accept a cookie which works fine in both Firefox and wget. The web server is Boa 0.94.13 (a small embedded server) using PHP...
16
by: Stevo | last post by:
I'm guessing this is a laughably obvious answer to many here, but it's not to me (and I don't have a server or any knowledge of PHP to be able to try it). It's not strictly a PHP question, but...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.