I have an issue with trying to add a new name-pair to an existing
cookie. Here's what I want to do:
page1 -
adds "loggedin=true" to cookie "Communities"
adds "member_id=100" to cookie "Communities"
page2 -
adds "banner=1" to cookie "Communities"
page 3 -
reads cookie "Communities"
first I would run page 1, then page 2 and finally page 3
in original ASP if I did this page would show something like:
cookie name: "Communities"
cookie value: "loggedin=true&member_id&100&banner=1"
but in my ASP.NET (C#) scripts, page 3 shows:
cookie name: "Communities"
cookie value: "banner=1"
it seems page 2 overwrites the cookie. Is there any way to add the
name-pair from page 2 without overwriting those from page 1?
If necessary I will stop using collections and just make multiple
cookies with a common prefix (such as commLoggedIn, commBanner, etc),
but I'd really like to keep collections, and in my current ASP code
(which is being updated to .NET) I have multiple collections.
I guess I could try and write a function that is passed a new or
existing name-value pair; reads the current value of the collection and
adds each one back individually either updating one or adding a new
one, but that seems too much effort.
any help appreciated