ThinkPHP5


think\Cookie
library\think\Cookie.php at line 14

Class Cookie

Cookie

public class Cookie


Method Summary
static void

init(array config)

Cookie初始化

static string|void

prefix(string prefix)

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

static mixed

set(string name, mixed value, mixed option)

Cookie 设置、获取、删除

static bool

has(string name, string|null prefix)

判断Cookie数据

static mixed

get(string name, string|null prefix)

Cookie获取

static mixed

delete(string name, string|null prefix)

Cookie删除

static mixed

clear(string|null prefix)

Cookie清空

Method Detail

library\think\Cookie.php at line 25

init

public static void init(array config)

Cookie初始化


library\think\Cookie.php at line 42

prefix

public static string|void prefix(string prefix)

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


library\think\Cookie.php at line 60

set

public static mixed set(string name, mixed value, mixed option)

Cookie 设置、获取、删除

Parameters:
name - cookie名称
value - cookie值
option - 可选参数 可能会是 null|integer|string
Internal:
param mixed $options cookie参数

library\think\Cookie.php at line 93

has

public static bool has(string name, string|null prefix)

判断Cookie数据

Parameters:
name - cookie名称
prefix - cookie前缀

library\think\Cookie.php at line 107

get

public static mixed get(string name, string|null prefix)

Cookie获取

Parameters:
name - cookie名称
prefix - cookie前缀

library\think\Cookie.php at line 131

delete

public static mixed delete(string name, string|null prefix)

Cookie删除

Parameters:
name - cookie名称
prefix - cookie前缀

library\think\Cookie.php at line 149

clear

public static mixed clear(string|null prefix)

Cookie清空

Parameters:
prefix - cookie前缀

ThinkPHP5