Hello I have an alert for if the cookie is set, how do I add an alert to see how many days the cookie is set to expire? That way I know I'm setting the cookie correctly? Please let me know, thank you very much for your help
Don't you trust the function? You can alert the creation string as shown below. There is no way (or need) to read the expiry date of an existing cookie. <script type="text/javascript"> function setCookie(name,value,days) { var expires = "", date = new Date(); if(days) expires = "; expires=" + new Date(date.setDate(date.getDate()+days)).toGMTString(); [COLOR="Red"]alert([/COLOR] document.cookie = name+"="+value+expires+"; path=/" [COLOR="red"])[/COLOR]; } setCookie('ss', 'sss', 365); </script> Code (markup):