PHP Class think\Session

Exibir arquivo Open project: top-think/framework Class Usage Examples

Protected Properties

Property Type Description
$init
$prefix

Public Methods

Method Description
boot ( ) : void session自动启动或者初始化
clear ( string | null $prefix = null ) : void 清空session数据
delete ( string $name, string | null $prefix = null ) : void 删除session数据
destroy ( ) : void 销毁session
get ( string $name = '', string | null $prefix = null ) : mixed session获取
has ( string $name, string | null $prefix = null ) : boolean 判断session数据
init ( array $config = [] ) : void session初始化
pause ( ) : void 暂停session
prefix ( string $prefix = '' ) : string | void 设置或者获取session作用域(前缀)
pull ( string $name, string | null $prefix = null ) : mixed session获取并删除
set ( string $name, mixed $value = '', string | null $prefix = null ) : void session设置
start ( ) : void 启动session

Private Methods

Method Description
regenerate ( boolean $delete = false ) : void 重新生成session_id

Method Details

boot() public static method

session自动启动或者初始化
public static boot ( ) : void
return void

clear() public static method

清空session数据
public static clear ( string | null $prefix = null ) : void
$prefix string | null 作用域(前缀)
return void

delete() public static method

删除session数据
public static delete ( string $name, string | null $prefix = null ) : void
$name string session名称
$prefix string | null 作用域(前缀)
return void

destroy() public static method

销毁session
public static destroy ( ) : void
return void

get() public static method

session获取
public static get ( string $name = '', string | null $prefix = null ) : mixed
$name string session名称
$prefix string | null 作用域(前缀)
return mixed

has() public static method

判断session数据
public static has ( string $name, string | null $prefix = null ) : boolean
$name string session名称
$prefix string | null
return boolean

init() public static method

session初始化
public static init ( array $config = [] ) : void
$config array
return void

pause() public static method

暂停session
public static pause ( ) : void
return void

prefix() public static method

设置或者获取session作用域(前缀)
public static prefix ( string $prefix = '' ) : string | void
$prefix string
return string | void

pull() public static method

session获取并删除
public static pull ( string $name, string | null $prefix = null ) : mixed
$name string session名称
$prefix string | null 作用域(前缀)
return mixed

set() public static method

session设置
public static set ( string $name, mixed $value = '', string | null $prefix = null ) : void
$name string session名称
$value mixed session值
$prefix string | null 作用域(前缀)
return void

start() public static method

启动session
public static start ( ) : void
return void

Property Details

$init protected_oe static_oe property

protected static $init

$prefix protected_oe static_oe property

protected static $prefix