greencode - 7:48 pm on May 25, 2012 (gmt 0)
I'm struggling a bit here. I found this code and I can't figure out how to be in total control of how long the cookie is stored for on the users machine. I've set it up but it seems to expire around 5 years time and I've no real idea why?!
I have this as as the cookie script:
var exdate=new Date()
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
and then when the user clicks this button it stores the cookie.
<a href="#" onClick="SetCookie('mycookie','mycookie','30')">Allow Cookies</a>
I just need to know how to set the expiry date for 365 days time?
Any ideas, help or advice would be much appreciated.