A simple function to read a cookie value.
function CookieValue (offset) {
var stringend = document.cookie.indexOf (";", offset);
if (stringend == -1)
stringend = document.cookie.length;
return unescape(document.cookie.substring(offset, stringend)).replace("+"," ");
}
function GetCookie (name) {
var argu = name + "=";
var alen = arg.length;
var clen = document.cookie.length;
var none = '';
var i = 0;
while (i < clen) {
var a = i + alen;
if (document.cookie.substring(i, a) == arg)
return CookieValue(a);
i = document.cookie.indexOf(" ", i) + 1;
if (i == 0) break;
}
return none;
}
How to use it?
An example may be the best way to understand hot to use this code. Assum you have a cookie named "MyCookie" with value "MyCookie+Value".
The function:
GetCookie('MyCookie')
Return: "MyCookie Value".
I'm working hard in this period. I hope to have more time to update the blog ASAP :)








