d52477001
06-04-2003, 01:22 PM
hi,
i am using the following script to write a cookie:
<html>
<head>
<SCRIPT LANGUAGE="JavaScript"><!--
function Set_Cookie(name,value,expires,path,domain,secure) {
document.cookie = name + "=" +escape(value) +
( (expires) ? ";expires=" + expires.toGMTString() : "") +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
( (secure) ? ";secure" : "");
}
var today = new Date();
var zero_date = new Date(0,0,0);
today.setTime(today.getTime() - zero_date.getTime());
var todays_date = new Date(today.getYear(),today.getMonth(),today.getDate(),0,0,0);
var expires_date = new Date(todays_date.getTime() + (52 * 7 * 86400000)); // 52 weeks
var name = 'cookied';
var value = '52477001';
Set_Cookie(name,value,expires_date);
//--></SCRIPT>
</head>
</html>
Now, if i want the cookie to expire after, say, 15 minutes, what should i edit? is it the 52*7*86400000?
thanks in advance,
d52477001
i am using the following script to write a cookie:
<html>
<head>
<SCRIPT LANGUAGE="JavaScript"><!--
function Set_Cookie(name,value,expires,path,domain,secure) {
document.cookie = name + "=" +escape(value) +
( (expires) ? ";expires=" + expires.toGMTString() : "") +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
( (secure) ? ";secure" : "");
}
var today = new Date();
var zero_date = new Date(0,0,0);
today.setTime(today.getTime() - zero_date.getTime());
var todays_date = new Date(today.getYear(),today.getMonth(),today.getDate(),0,0,0);
var expires_date = new Date(todays_date.getTime() + (52 * 7 * 86400000)); // 52 weeks
var name = 'cookied';
var value = '52477001';
Set_Cookie(name,value,expires_date);
//--></SCRIPT>
</head>
</html>
Now, if i want the cookie to expire after, say, 15 minutes, what should i edit? is it the 52*7*86400000?
thanks in advance,
d52477001