JavaScript code for cookie not working in Chrome

后端 未结 5 1308
谎友^
谎友^ 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:20

    Chrome doesn’t store cookies from the pages which are loaded from local file system. For example if you are accessing a HTML file in chrome browser from local file system(ex: file:///C:/Users/deepak.r/Desktop/test.html), cookies are not supported.

提交回复
热议问题