Microsoft
Software
Hardware
Network
Question : Setting javascript cookies properly
I am setting a cookie like so:
document.cookie = 'name=value';
The problem I am having is that after I close the browser, the cookie gets deleted.
How can I set the cookie so that it stays "permenantly"
Answer : Setting javascript cookies properly
just simply put the expiry date to a bigger value, something like
function setCookie(name, value)
{
var expirydate = (new Date(2200, 1, 1)).toGMTString();
document.cookie = name + "=" + escape(value) + "; expires=" + expirydate ;
}
Random Solutions
Timers in Foxpro
Passing a structure from VBA in Excel to a C DLL
how to prevent others to see my website without logging in
Pervasive SQL 9.5 - odbc SELECT Query - DATE = '0000-00-00'
Ping from Cisco Switch
How to deny write to the desktop for users?
Windows 7 Group Policy Bug?
I have a Toshiba Satellite A105 Laptop, and Hard Drive From Dell Vostro 1500 w/ Win 7 wont boot?
Deploy Printer Drivers to WinXP Computers
use desktop monitor screen with laptop