当前位置:网站首页>Solve the problem of storing cookies in IE7 & IE8
Solve the problem of storing cookies in IE7 & IE8
2022-07-26 09:46:00 【Dark cloud_ Go away】
solve IE7 & IE8 Storage cookie problem
I've been working on a project recently , You need a browser that is compatible with a lower version , Now it is still used xp Systematic IE7 !!!! When I heard the news, I was all bad .
One of these functions requires cookie Store and clear , Found in ie8 And then there is no effect . resolvent :
/** * Set up cookie * @param {String} key * @param {String} value * @param {Number} expires The unit is in seconds * @param {String} path route * @param {String} domain host * @param {Boolean} secure Security level */
function setCookie(key, value, expires, path, domain, secure) {
// key If it is invalid, do nothing
if (!key) {
return;
}
// all cookie Of key All lowercase
key = key.toLowerCase();
key = key + '=' + escape(value) + ";";
expires = expires ? ("expires=" + new Date(new Date().getTime() + expires * 1000).toGMTString()) + ";" : "";
path = !!path ? "path=" + path + ";" : "path=/;";
domain = domain ? ("domain=" + domain) + ";" : "";
secure = secure ? "secure=true;" : "";
document.cookie = [key, expires, path, domain, secure].join("");
}
// eliminate cookie
function clearCookie(name) {
var e = new Date();
e.setTime(e.getTime() - 1);
var b = getCookie(name);
document.cookie = name + "=" + name + ";path=/; domain=" + window.location.host + "; expires=" + e.toGMTString()
}
True and effective !!!!!
边栏推荐
- 【Mysql数据库】mysql基本操作集锦-看得会的基础(增删改查)
- JS judge the data types object.prototype.tostring.call and typeof
- v-for动态设置img的src
- POJ 1012 Joseph
- 2022 zhongkepan cloud - server internal information acquisition and analysis flag
- Basic knowledge of website design
- 新公链Aptos何以拉满市场期待值?
- 编写一个在bash / shell 和 PowerShell中均可运行的脚本
- QT handy notes (III) use qtcharts to draw a line chart in VS
- 高斯消元求解矩阵的逆(gauss)
猜你喜欢

V-permission add permission

Server and client dual authentication (2)

开发转测试:从0开始的6年自动化之路...

Drawing shadow error diagram with MATLAB

2019 ICPC Asia Yinchuan regional (water problem solution)

B站这个视频我是跪着看完的

服务器、客户端双认证(2)

Does volatile rely on the MESI protocol to solve the visibility problem? (top)

2022 zhongkepan cloud - server internal information acquisition and analysis flag

AR model in MATLAB for short-term traffic flow prediction
随机推荐
Node 内存溢出及V8垃圾回收机制
系统安装Serv-U后IIS出错提示:HRESULT:0x80070020
Flutter Event 派发
After attaching to the process, the breakpoint displays "currently will not hit the breakpoint, and no symbols have been loaded for this document"
B站这个视频我是跪着看完的
R language ggplot2 visualization: align the legend title to the middle of the legend box in ggplot2 (default left alignment, align legend title to middle of legend)
Force deduction brush questions, sum of three numbers
莫队学习总结(二)
服务器环境配置全过程
AR model in MATLAB for short-term traffic flow prediction
OFDM Lecture 16 - OFDM
antd TreeSelect获取父节点的值
Search module use case writing
解决npm -v突然失效 无反应
Xiaobai makes a wave of deep copy and shallow copy
Malloc failed to allocate space and did not return null
[Online deadlock analysis] by index_ Deadlock event caused by merge
Azkaban【基础知识 01】核心概念+特点+Web界面+架构+Job类型(一篇即可入门Azkaban工作流调度系统)
图解用户登录验证流程,写得太好了!
[datawhale] [machine learning] Diabetes genetic risk detection challenge