JavaScript code for cookie not working in Chrome

后端 未结 5 1352
谎友^
谎友^ 2021-01-01 16:59

The following code works fine in FF:

var date = new Date();
date.setTime(date.getTime() + (1 * 24 * 60 * 60 * 1000));
expires = \"; expires=\" + date.toGMTSt         


        
5条回答
  •  盖世英雄少女心
    2021-01-01 17:26

    Make sure your address bar url matches the domain. In Chrome if you set domain=www.site.com and then test your page in the browser missing out the www. it won't work.

提交回复
热议问题