The following function sets the cookie to take advantage of Setcookie (CookieName, cookievalue, seconds, path, domain, secure), as well as to remove it as a cookie.
*/
Function GetCookie (name) {
var Cookie_start = document.cookie.indexof (name);
var Co Okie_end = Document.cookie.indexof (";", Cookie_start);
return Cookie_start = = 1? ': unescape (document.cookie.substring Cookie_start + name.length + 1, cookie_end > Cookie_start? cookie_end:docum ent.cookie.length)));
}
Function Setcookie (cookiename, cookievalue, seconds, path, domain, secure) {
var expires = new D Ate ();
expires.settime (Expires.gettime () + seconds * 1000);
domain =!domain? cookiedomain:domain;
path =!path? Cookiepath:path;
document.cookie = Escape (cookiename) + ' = ' + Escape (cookievalue)
+ (expires? '; Expires= ' + expires.togmtstring (): ')
+ (path?) '; Path= ' + path: '/'
+ (domain? '; Domain= ' + domain: ')
+ (secure? '; Secure ': ');
}