Hi,
I'm setting up a cookie at the beginning of a long-winded application (lots of data entry) and by the time I want to retrieve it (maybe 30 minutes later) to save to database its gone!
I've tried seting Expires property to 2 days in advance to no avail. Code is below - the Response.Cookies statement is at bottom. Any suggestions gratefully received.
<SCRIPT language=vbscript runat=server>
Function addDate(thedate)
addDate = DateAdd("d", 2, thedate)
End Function
</SCRIPT>
</head>
<body>
<%
var dt = new Date();
var mon = dt.getMonth() + 1;
var today = dt.getDate();
var tomorrow = dt.getDate();
if (today < "10"
{
today = "0" + dt.getDate();
}
if (tomorrow < "10"
{
tomorrow = "0" + tomorrow;
}
var yr = dt.getFullYear();
var sdate = today + "/" + mon + "/" + yr;
var sysdate = tomorrow + "/" + mon + "/" + yr;
sysdate = addDate(sysdate);
Response.Cookies("staffid" = loRS.fields.getValue("PERSON_ID"
Response.Cookies("staffid".Expires = sysdate;
%>
I'm setting up a cookie at the beginning of a long-winded application (lots of data entry) and by the time I want to retrieve it (maybe 30 minutes later) to save to database its gone!
I've tried seting Expires property to 2 days in advance to no avail. Code is below - the Response.Cookies statement is at bottom. Any suggestions gratefully received.
<SCRIPT language=vbscript runat=server>
Function addDate(thedate)
addDate = DateAdd("d", 2, thedate)
End Function
</SCRIPT>
</head>
<body>
<%
var dt = new Date();
var mon = dt.getMonth() + 1;
var today = dt.getDate();
var tomorrow = dt.getDate();
if (today < "10"
{
today = "0" + dt.getDate();
}
if (tomorrow < "10"
{
tomorrow = "0" + tomorrow;
}
var yr = dt.getFullYear();
var sdate = today + "/" + mon + "/" + yr;
var sysdate = tomorrow + "/" + mon + "/" + yr;
sysdate = addDate(sysdate);
Response.Cookies("staffid" = loRS.fields.getValue("PERSON_ID"
Response.Cookies("staffid".Expires = sysdate;
%>