alorel/alo-cookie
最新稳定版本:1.1
Composer 安装命令:
composer create-project alorel/alo-cookie
包简介
A simple JavaScript cookie manager
README 文档
README
What is this sorcery ?
It's a simple class to manipulate cookies in an object-oriented manner.
Usage
Get all document cookies
var cookies = AloCookie.getAll();
// {name1:value1, name2:value2 ...}
Setting cookie "foo"
var cookie = new AloCookie("foo");
cookie.value = "bar";
cookie.expire = 3600; //in 1 hour. Defaults to expire at the end of the session
cookie.domain = "www.example.com"; //defaults to window.location.hostname
cookie.path = "/cart/checkout"; // Defaults to "/"
cookie.secure = true; // true sends the cookie only via HTTPS. Defaults to window.location.protocol == "https:"
cookie.save()
Check if cookie called "foo" exists
var cookie = new AloCookie("foo"),
cookieExists = cookie.exists();
Deleting cookie "foo"
var cookie = new AloCookie("foo");
cookie.remove();
统计信息
- 总下载量: 186
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0
- 更新时间: 2015-07-13
