Class: WindCookie
Source Location: /utility/WindCookie.php
Class WindCookie
Method Summary
static
boolean
|
delete() |
根据cookie的名字删除cookie |
static
boolean
|
exist() |
判断cookie是否存在 |
static
mixed
|
get() |
取得指定名称的cookie值 |
static
boolean
|
set() |
设置cookie |
Methods
static boolean delete(
string
$name
)
|
|
根据cookie的名字删除cookie
Parameters:
API Tags:
Return: | 删除成功返回true |
Access: | public |
static boolean deleteAll(
)
|
|
移除全部cookie
API Tags:
Return: | 移除成功将返回true |
Access: | public |
static boolean exist(
string
$name
)
|
|
判断cookie是否存在
Parameters:
API Tags:
Return: | 如果不存在则返回false,否则返回true |
Access: | public |
static mixed get(
string
$name, [boolean
$dencode = false]
)
|
|
取得指定名称的cookie值
Parameters:
string |
$name: |
cookie名称 |
boolean |
$dencode: |
是否对cookie值进行过解码,默认为false即不用解码 |
API Tags:
Return: | 获取成功将返回保存的cookie值,获取失败将返回false |
Access: | public |
static boolean set(
string
$name, [string
$value = null], [boolean
$encode = false], [string|int
$expires = null], [string
$path = null], [string
$domain = null], [boolean
$secure = false], [boolean
$httponly = false]
)
|
|
设置cookie
Parameters:
string |
$name: |
cookie名称 |
string |
$value: |
cookie值,默认为null |
boolean |
$encode: |
是否使用 MIME base64 对数据进行编码,默认是false即不进行编码 |
string|int |
$expires: |
过期时间,默认为null即会话cookie,随着会话结束将会销毁 |
string |
$path: |
cookie保存的路径,默认为null即采用默认 |
string |
$domain: |
cookie所属域,默认为null即不设置 |
boolean |
$secure: |
是否安全连接,默认为false即不采用安全链接 |
boolean |
$httponly: |
是否可通过客户端脚本访问,默认为false即客户端脚本可以访问cookie |
API Tags:
Return: | 设置成功返回true,失败返回false |
Access: | public |
|
|