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:
<script>
function SetCookie(c_name,value,expiredays)
{
var exdate=new Date()
exdate.setDate(exdate.getDate()+expiredays)
document.cookie=c_name+ "=" +escape(value)+
((expiredays==null) ? "" : ";expires="+exdate.toGMTString())
}
</script>
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.