I have a cookie I am setting when a user clicks a button on a form with the following "OnClick" handler...
<input type="button"
OnClick="
alert(document.cookie);
var d;
d = new Date();
d.setDate(d.getDate() + 365);
document.cookie = 'LanguageReference' + '=' + document.forms[0].UserSelectedLanguage.value + ';expires=' + d.toGMTString();
document.forms[0].submit();" >
This works great but I've noticed some strange behavior with it when I display the contents of document.cookie and when I have changed the value of "LanguageReference" multiple times. The "LanguageReference" cookie will show up multiple times under document.cookie with different values.
This is what I get...
LanguageReference=en;LanguageReference=fr;... bunch of other cookies ...
This doesn't appear to be affecting retrieval of the cookie oddly enough which is great. I always get back what I want. But I fear there may be an underlying issue I'm not fully understanding which is going to bite me down the road.