简体   繁体   中英

Inconsistent cookie setting behaviour

So I have the following code to set the javascript cookie in the url here

document.cookie = key + '=' + value + expires + cookieDomain + 
cookiePath + secureCookieFlag;

with the following params

key : "location-and-language", value : "us|en", expires : "; expires=Thu, 31 Dec 2037 00:00:00 GMT", cookieDomain : ";, domain=.name.com", cookiePath : "; path=/", secureCookieFlag : ""

Now the issue is, when I run the same code in two different chrome instances

1) normal tab : the cookie is set
2) incognito tab : the cookie is not set

Requesting anyone to please help me understand why this different behaviour only because of incognito mode?

The purpose of incognito mode is to permit users to navigate without having their history saved in the browser. That includes visited urls, cookies, site and forms data they possibly gathered or entered.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM