I am using popular jquery Cookie plugin https://github.com/carhartl/jquery-cookie
Wonder how to set and read a cookie with multiple values? Or maybe it’s possible to add/remove values for that cookie?
$.cookie(“MyTestCookie”, email, { expires: 10 });
I want to add username to the same cookie
Update: just an example in .Net Storing multiple values in cookies
If you want to set a cookie that has multiple values or “subkeys” and have them readable from .NET, you need to store the subkey as name-value pairs formatted like a querystring. You can use the jQuery.param() method to convert a Javascript object into a querystring.
Then on the server, you can access the values as:
EDIT: I created a test page to show reading/writing multi-value cookies both on the server and client. http://www.systemex.net/Cookies/
NOTES:
Anyway hope this helps.
Here is Default.aspx
Default.aspx.cs