P
piet
Hi
I have taken this script from internet:
function setCookie(NameOfCookie, value, expiredays) {
var ExpireDate = new Date();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 *
1000));
document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays
== null) ? "" : "; expires=" + ExpireDate.toGMTString() ) ;
}
It writtes a value to a cookie.
Now I need to be able to use this value across my whole website,
including different directories. eg. website/
and website/rec/
How would I do this?
I also have this function to delete the cookie: does it need changing
as well? function delCookie (NameOfCookie) {
if (getCookie(NameOfCookie)) {document.cookie = NameOfCookie + "="
+"; expires=Thu, 01-Jan-70 00:00:01 GMT" ; }
}
txs
Piet
I have taken this script from internet:
function setCookie(NameOfCookie, value, expiredays) {
var ExpireDate = new Date();
ExpireDate.setTime(ExpireDate.getTime() + (expiredays * 24 * 3600 *
1000));
document.cookie = NameOfCookie + "=" + escape(value) + ((expiredays
== null) ? "" : "; expires=" + ExpireDate.toGMTString() ) ;
}
It writtes a value to a cookie.
Now I need to be able to use this value across my whole website,
including different directories. eg. website/
and website/rec/
How would I do this?
I also have this function to delete the cookie: does it need changing
as well? function delCookie (NameOfCookie) {
if (getCookie(NameOfCookie)) {document.cookie = NameOfCookie + "="
+"; expires=Thu, 01-Jan-70 00:00:01 GMT" ; }
}
txs
Piet