Properties

$handlerClass

$handlerClass : string

Session处理类

Type

string

$isStart

$isStart : boolean

是否已经启动

Type

boolean

$id

$id : string

session id

Type

string

$data

$data : array

Session 数据

Type

array

$isChanged

$isChanged : boolean

是否对Session数据有修改

Type

boolean

$isNewSession

$isNewSession : boolean

当前是否是新的会话

Type

boolean

Methods

start()

start(\Imi\Server\Session\string  $sessionID = null) : void

开启session

Parameters

\Imi\Server\Session\string $sessionID

close()

close() : void

关闭session

destroy()

destroy() : void

销毁session

save()

save() : void

保存session

commit()

commit() : void

保存并关闭session

isStart()

isStart() : boolean

是否已开启session

Returns

boolean

getName()

getName() : string

获取session name

Returns

string

getID()

getID() : string

获取session id

Returns

string

tryGC()

tryGC() : void

按概率进行尝试垃圾回收

gc()

gc() : void

垃圾回收

get()

get(string  $name = null, mixed  $default = null) : mixed

获取Session值

Parameters

string $name
mixed $default

Returns

mixed

set()

set(string  $name, mixed  $value) : void

设置Session值

Parameters

string $name
mixed $value

delete()

delete(string  $name) : void

删除Session值

Parameters

string $name

once()

once(string  $name, mixed  $default = null) : mixed

获取一次值后将该值删除,可用于验证码等一次性功能

Parameters

string $name
mixed $default

Returns

mixed

clear()

clear() : void

清空所有Session

parseName()

parseName(string  $name) : string

处理name名称,@替换为前缀

Parameters

string $name

Returns

string

isChanged()

isChanged() : boolean

是否修改了Session数据

Returns

boolean

isNewSession()

isNewSession() : boolean

当前是否是新的会话

Returns

boolean