js 操作COOKE备忘
2024-08-25 22:57:41
function getCookie(c_name)
{
if (document.cookie.length > 0)
{
c_start = document.cookie.indexOf(c_name + "=");
if (c_start!=-1)
{
c_start = c_start + c_name.length + 1;
c_end = document.cookie.indexOf(";", c_start);
if (c_end == -1)
{
c_end = document.cookie.length;
}
return unescape(document.cookie.substring(c_start,c_end))
}
}
return ""
} function setCookie(c_name,value,expiredays)
{
var exdate = new Date();
exdate.setDate(exdate.getDate() + expiredays);
document.cookie=c_name+ "=" + escape(value) +
((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
最新文章
- MySQL数据库中delimiter的作用概述
- 介绍开源的.net通信框架NetworkComms框架之六 x509证书通信
- 程序中条用其他程序中已经存在的PERFORM
- SharePoint 2013 术语和术语集介绍
- Chapter 5: Container
- zend studio 快捷键收集
- Go语言(golang)开源项目大全
- 【Apache ZooKeeper】为ZNode设置watcher
- python 目录文件
- appium问题整理
- linux设备驱动模块引用和依赖
- win10双系统安装卸载ubuntu
- H5_0005:JS判断域名和时间有效期的方法
- numpy创建array【老鱼学numpy】
- HTTP Server to Client Communication
- JUC同步锁(五)
- maven - 配置强制从指定仓库拉取jar包
- maven 结合mybaits整合框架,打包时mapper.xml文件,mapper目录打不进war包去问题
- webservice的 发布
- python多线程概念
热门文章
- 读<;jquery 权威指南>;[2]-事件
- Rest接口测试,巧用firebug插件
- CodeForces #369 div2 D Directed Roads DFS
- myeclipse启动tomcat会出现 a java exception has occured错误 的解决方法
- MySQL与SqlServer中update操作同一个表问题
- SQL语句---nvl 用法
- C#日志记录函数
- VC中预处理指令与宏定义详解
- CBC和CTR解密模式——C++实现
- 循环数据forin,foreach,for of