Javascript Cookie with no expiration date

前端 未结 9 926

I would like to set up a cookie that never expires. Would that even be possible?

 document.cookie = \"name=value; expires=date; path=path;domain=domain; secu         


        
9条回答
  •  庸人自扰
    2020-11-27 14:10

    You could possibly set a cookie at an expiration date of a month or something and then reassign the cookie every time the user visits the website again

提交回复
热议问题