One Cookie - Multiple Pages

后端 未结 2 1258
攒了一身酷
攒了一身酷 2020-12-05 21:10

I am using the following cookie:

var $j = jQuery.noConflict();

$j(document).ready(function(){

   if (document.cookie.indexOf(\'visited=true\') == -1) 
            


        
2条回答
  •  旧时难觅i
    2020-12-05 21:43

    document.cookie = valuename + "=" + value + "; " + expires + ";domain=;path=/";
    

    This "domain=;path=/"; will take dynamic domain as its cookie will work in subdomain. It will work if you want to test in localhost.

提交回复
热议问题