\thinkCookie

Summary

Methods
Properties
Constants
init()
prefix()
forever()
has()
get()
delete()
clear()
No public properties found
No constants found
No protected methods found
$config
$init
N/A
jsonFormatProtect()
No private properties found
N/A

Properties

$config

$config : 

Type

$init

$init : 

Type

Methods

init()

init(array  $config = array()) : void

Cookie初始化

Parameters

array $config

prefix()

prefix(string  $prefix = '') : string|void

设置或者获取cookie作用域(前缀)

Parameters

string $prefix

Returns

string|void

forever()

forever(string  $name, mixed  $value = '', mixed  $option = null) : void

永久保存Cookie数据

Parameters

string $name

cookie名称

mixed $value

cookie值

mixed $option

可选参数 可能会是 null|integer|string

has()

has(string  $name, string|null  $prefix = null) : boolean

判断Cookie数据

Parameters

string $name

cookie名称

string|null $prefix

cookie前缀

Returns

boolean

get()

get(string  $name = '', string|null  $prefix = null) : mixed

Cookie获取

Parameters

string $name

cookie名称

string|null $prefix

cookie前缀

Returns

mixed

delete()

delete(string  $name, string|null  $prefix = null) : mixed

Cookie删除

Parameters

string $name

cookie名称

string|null $prefix

cookie前缀

Returns

mixed

clear()

clear(string|null  $prefix = null) : mixed

Cookie清空

Parameters

string|null $prefix

cookie前缀

Returns

mixed

jsonFormatProtect()

jsonFormatProtect(  $val,   $key,   $type = 'encode') 

Parameters

$val
$key
$type