Wow. That was more than I expected - but not really what I needed. My fault for not being exactly clear. This is for a JavaScripted shopping cart application. When a user clicks an item's checkbox, JS determines if the box is checked or not, then adds/adjusts the cookie. The checkbox might be named "bill", so onClick=setCookie(this.name,this.checked) leads to setCookie(property,value) and document.cookie=property+"="+value.
Problem is this creates a NEW cookie each time. Doesn't matter if a user unchecks a box, the cookie is still there (just set to "false"). So - after 20 clicks (20 cookies) the cart fails as browsers can only handle 20 cookies. The solution - use 1 cookie with name-value keys.
I need 3 variables to reference my cookie like I can do with ASP. I can easily create Response.Cookies("myCookie")("bill")=("true") then add Response.Cookies("myCookie")("sam")=("true"). One cookie with 2 pieces of information. With JS I try document.cookie="myCookie:bill=true" and "myCookie:sam=true" - but this makes 2 cookies (myCookie:bill and myCookie:sam) rather than one named "myCookie". If I try "myCookie=bill:true" and "myCookie=sam:true", the bill is lost as sam overwrites it.