http://qs321.pair.com?node_id=90180


in reply to Seeking help to avoid duplicate cookies

I hate to be an unhelpful jerk, but what you're describing is unlikely at best, and most probably impossible.

Try this JS code:

<html> <head> <script language="JavaScript"> function setCookie() { document.cookies = "foo=bar"; } function getCookies() { window.alert("Cookies: " + document.cookies); } </script> </head> <body> <form> <p align="center"><input type="button" value="Set A Cookie" onClick="s +etCookie();"></p> </form> </body> </html>

No matter how many times you click setCookie there's only that one cookie there. By definition cookies have to have unique names, AFAIK.

It sounds like your code is doing something unexpected in terms of how it sets/reads cookies.

Try posting some code and we can take a look...

And on a final note, if you're setting the cookie via JavaScript and reading via Perl then the error could be quite simple:

Try it by changing "=" to "+=" in my code.

HTH

Replies are listed 'Best First'.
Re^2: Seeking help to avoid duplicate cookies
by Burak (Chaplain) on Jul 30, 2007 at 18:04 UTC
    By the way, I wrote a JSAN module for handling cookies from JS: HTTP.Cookies
Re: Seeking help to avoid duplicate cookies
by Anonymous Monk on Jul 30, 2007 at 05:24 UTC
    Actually HTH, this IS an IE error. it happems when the same cookie name is set from different pages, even in the same folder It seems M$ have broken the cookie code. when reading you always get the last one, or none if the page reading is different from the original one that set it the only way around this is to use a while loop on the cookie in question, expiring it until it no longer exists, then setting it again Paul