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:
- You read cookies in JavaScript as if they were a single string,
- but you write to them automagically via a simple assignment
- so if you're saying document.cookies += cookieNames you're going to get some interesting results (i.e. multiple cookies that, apparently, have the same name)
Try it by changing "=" to "+=" in my code.
HTH
In Section
Seekers of Perl Wisdom