鍍金池/ 問答/HTML5  Python  HTML/ js如何更改cookies的某個值

js如何更改cookies的某個值

我先設(shè)置一個cookie,

currentGlobalStyle = true;

document.cookie = 'currentGlobalStyle=true';

現(xiàn)在的輸出結(jié)果是:

login_region="http://192.168.6.85:5000/v2.0"; scope=system_admin; recent_project=123; currentGlobalStyle=true; csrftoken=123

當(dāng)我退出登錄,或者執(zhí)行某個方法時,如何將currentGlobalStyle改為false。

回答
編輯回答
朽鹿

如果域名和路徑相同的話,直接設(shè)置一個currentGlobalStyle為false的cookie就會把之前的覆蓋掉

2018年7月14日 20:14