People of Earth! Cookies will not be saved by your browser when operating from a local file://
URL! Do not waste time writing your own little cookie functions out of the forlorn, astounded believe that everyone else out there, e.g., jQuery, is somehow just crazy and doing something wrong!
function getCookie(get) { var cookies = document.cookie.split(";"); var i, name; for (i = 0; i < cookies.length; i++) { name = cookies[i].substr(0,cookies[i].indexOf("=")) .replace(/^\s+|\s+$/g,""); if (name == get) { return unescape(cookies[i].substr(cookies[i].indexOf("=")+1)); } } return null; } function setCookie(name, value, days) { var expDate = new Date(); expDate.setDate(expDate.getDate() + days); var cookie = escape(value) + ((days==null) ? "" : "; expires="+expDate.toUTCString()); document.cookie = name + "=" + cookie; } function deleteCookie(name) { setCookie(name, null, -1); }