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
When closing Excel several computers are getting an error
How do I change the default directory for program files in server 2008 r2?
Appointment booking app or service for field engineers?
How do I read an unsigned character in C#?
Extremely slow access to Redirected Folders in SBS2008 with XP Pro clients
change sched task pw via command line
How to Populate a ListBox Control with Values from an Access Database Table
Oracle packages
what is most cost effective way to backup windows 2008 sbs
Create linked server from MS Sql to oracle server