I seem to be having trouble storing a cookie and then reading back its value.
The cookie I'm writing is Name = TransloadingInventory-filter
, Value = Consignee:HALLIBURTON ENERGY SERVICES::ProductCategory:1::Product:2
.
But as soon as I write this value, the browser shows the current value for this cookie is Consignee:::ProductCategory:::Product:
.
In addition, I don't know if this is related but when I try and read the Request.Form
in ASP.NET, I get the exception Incorrect Content-Type:
.
Is there an issue putting colons in cookie values? Can someone suggest some troubleshootng steps? Here's the function I'm using to write the cookie.
function setCookie(name, value, days) {
var expires = ';'
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
var expires = '; expires=' + date.toUTCString();
}
document.cookie = name + '=' + value + expires + '; path=/';
}