Javascript Cookie with no expiration date

前端 未结 9 908

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 13:56

    If you intend to read the data only from the client-side, you can use the local storage. It's deleted only when the browser's cache is cleared.

提交回复
热议问题