\Session

+------------------------------------------------------------------------------ Session管理类 +------------------------------------------------------------------------------

Summary

Methods
Properties
Constants
start()
pause()
clearLocal()
clear()
destroy()
detectID()
name()
id()
path()
setExpire()
setIdle()
sessionValidThru()
isExpired()
isIdle()
updateIdle()
setCallback()
useCookies()
isNew()
getLocal()
get()
setLocal()
set()
is_setLocal()
is_set()
localName()
_init()
useTransSID()
setCookieDomain()
setGcMaxLifetime()
setGcProbability()
getFilename()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

start()

start() : void

+---------------------------------------------------------- 启动Session +----------------------------------------------------------

pause()

pause() : void

+---------------------------------------------------------- 暂停Session +----------------------------------------------------------

clearLocal()

clearLocal() : void

+---------------------------------------------------------- 清空Session +----------------------------------------------------------

clear()

clear() : void

+---------------------------------------------------------- 清空Session +----------------------------------------------------------

destroy()

destroy() : void

+---------------------------------------------------------- 销毁Session +----------------------------------------------------------

detectID()

detectID() : void

+---------------------------------------------------------- 检测SessionID +----------------------------------------------------------

name()

name(string  $name = null) : string

+---------------------------------------------------------- 设置或者获取当前Session name +----------------------------------------------------------

Parameters

string $name

session名称 +----------------------------------------------------------

Returns

string —

返回之前的Session name +----------------------------------------------------------

id()

id(string  $id = null) : void

+---------------------------------------------------------- 设置或者获取当前SessionID +----------------------------------------------------------

Parameters

string $id

sessionID +----------------------------------------------------------

path()

path(string  $path = null) : string

+---------------------------------------------------------- 设置或者获取当前Session保存路径 +----------------------------------------------------------

Parameters

string $path

保存路径名 +----------------------------------------------------------

Returns

string —

+----------------------------------------------------------

setExpire()

setExpire(integer  $time, boolean  $add = false) : void

+---------------------------------------------------------- 设置Session 过期时间 +----------------------------------------------------------

Parameters

integer $time

过期时间

boolean $add

是否为增加时间 +----------------------------------------------------------

setIdle()

setIdle(integer  $time, boolean  $add = false) : void

+---------------------------------------------------------- 设置Session 闲置时间 +----------------------------------------------------------

Parameters

integer $time

闲置时间

boolean $add

是否为增加时间 +----------------------------------------------------------

sessionValidThru()

sessionValidThru() : void

+---------------------------------------------------------- 取得Session 有效时间 +----------------------------------------------------------

isExpired()

isExpired() : boolean

+---------------------------------------------------------- 检查Session 是否过期 +----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

isIdle()

isIdle() : void

+---------------------------------------------------------- 检查Session 是否闲置 +----------------------------------------------------------

updateIdle()

updateIdle() : void

+---------------------------------------------------------- 更新Session 闲置时间 +----------------------------------------------------------

setCallback()

setCallback(string  $callback = null) : boolean

+---------------------------------------------------------- 设置Session 对象反序列化时候的回调函数 返回之前设置 +----------------------------------------------------------

Parameters

string $callback

回调函数方法名 +----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

useCookies()

useCookies(boolean  $useCookies = null) : boolean

+---------------------------------------------------------- 设置Session 是否使用cookie 返回之前设置 +----------------------------------------------------------

Parameters

boolean $useCookies

是否使用cookie +----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

isNew()

isNew() : boolean

+---------------------------------------------------------- 检查Session 是否新建 +----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

getLocal()

getLocal(string  $name) : boolean

+---------------------------------------------------------- 取得当前项目的Session 值 返回之前设置 +----------------------------------------------------------

Parameters

string $name

+----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

get()

get(string  $name) : boolean

+---------------------------------------------------------- 取得当前项目的Session 值 返回之前设置 +----------------------------------------------------------

Parameters

string $name

+----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

setLocal()

setLocal(string  $name, mixed  $value) : boolean

+---------------------------------------------------------- 设置当前项目的Session 值 返回之前设置 +----------------------------------------------------------

Parameters

string $name
mixed $value

+----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

set()

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

+---------------------------------------------------------- 设置当前项目的Session 值 返回之前设置 +----------------------------------------------------------

Parameters

string $name
mixed $value

+----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

is_setLocal()

is_setLocal(string  $name) : boolean

+---------------------------------------------------------- 检查Session 值是否已经设置 +----------------------------------------------------------

Parameters

string $name

+----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

is_set()

is_set(string  $name) : boolean

+---------------------------------------------------------- 检查Session 值是否已经设置 +----------------------------------------------------------

Parameters

string $name

+----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

localName()

localName(string  $name = null) : string

+---------------------------------------------------------- 设置或者获取 Session localname +----------------------------------------------------------

Parameters

string $name

+----------------------------------------------------------

Returns

string —

+----------------------------------------------------------

_init()

_init() : boolean

+---------------------------------------------------------- Session 初始化 +----------------------------------------------------------

Returns

boolean —

+----------------------------------------------------------

useTransSID()

useTransSID(string  $useTransSID = null) : string

+---------------------------------------------------------- 设置Session use_trans_sid 返回之前设置 +----------------------------------------------------------

Parameters

string $useTransSID

+----------------------------------------------------------

Returns

string —

+----------------------------------------------------------

setCookieDomain()

setCookieDomain(string  $sessionDomain = null) : string

+---------------------------------------------------------- 设置Session cookie_domain 返回之前设置 +----------------------------------------------------------

Parameters

string $sessionDomain

+----------------------------------------------------------

Returns

string —

+----------------------------------------------------------

setGcMaxLifetime()

setGcMaxLifetime(  $gcMaxLifetime = null) : string

+---------------------------------------------------------- 设置Session gc_maxlifetime值 返回之前设置 +----------------------------------------------------------

Parameters

$gcMaxLifetime

Returns

string —

+----------------------------------------------------------

setGcProbability()

setGcProbability(  $gcProbability = null) : string

+---------------------------------------------------------- 设置Session gc_probability 值 返回之前设置 +----------------------------------------------------------

Parameters

$gcProbability

Returns

string —

+----------------------------------------------------------

getFilename()

getFilename() : string

+---------------------------------------------------------- 当前Session文件名 +----------------------------------------------------------

Returns

string —

+----------------------------------------------------------