Javascript Cookie

前端 未结 2 1113
你的背包
你的背包 2020-12-15 12:07

How can i create a cookie by using javascript just for end of the browser session(ie,upto closing of current browser).My script is like follows;

function set         


        
相关标签:
2条回答
  • 2020-12-15 12:32

    Setting c_expiredays to 0 (without quotes) should do the trick.

    0 讨论(0)
  • 2020-12-15 12:39

    If you dont set any expire time, the cookie will be deleted upon closing of the browser:

    setCookie('gs_cookie','firstme');
    
    0 讨论(0)
提交回复
热议问题