Session 管理类

属性
命名空间 fize\web
类名 Session
方法:
方法名 说明
__construct() 构造
get() 获取一个 Session 值
has() 查看指定 Session 值是否存在
set() 设置一个 Session 值
remove() 删除一个 Session
clear() 清空 SESSION

方法

__construct()

构造

public function __construct (
    array $config = []
)
参数:
名称 说明
config 配置
在构造方法中初始化 Session 底层管理
使用 Session 静态方法前请先执行初始化

get()

获取一个 Session 值

public static function get (
    string $name,
    mixed $default = null
) : mixed
参数:
名称 说明
name 名称
default 默认值

has()

查看指定 Session 值是否存在

public static function has (
    string $name
) : bool
参数:
名称 说明
name 名称

set()

设置一个 Session 值

public static function set (
    string $name,
    mixed $value
)
参数:
名称 说明
name 名称
value

remove()

删除一个 Session

public static function remove (
    string $name
)
参数:
名称 说明
name 名称

clear()

清空 SESSION

public static function clear ()