Session
in package
Session wrapper
Table of Contents
Properties
- $defaultLifetime : int
- Default session lifetime value
Methods
- destroy() : void
- Destroy session
- get() : mixed
- Return session value or default value if session variable missing
- getEndTime() : int
- Get session end time.
- getId() : string
- Get session Id
- getLifetime() : int
- Return session lifetime
- getParams() : array<string|int, mixed>
- Get session params
- getStartTime() : int
- Get session start time
- getStatus() : int
- Get session status
- isActive() : bool
- Return true if session is active
- isStarted() : bool
- Return true if session is started
- isUseCookies() : bool
- Return true if session is stored in cookies
- recrete() : bool
- Urecreate session
- remove() : void
- Remove session value
- restart() : void
- Clear all session varibales and start new sesion
- set() : void
- Set value
- setLifetime() : void
- Set session lifetime
- start() : void
- Start session
- toArray() : array<string|int, mixed>
- Get session array
Properties
$defaultLifetime
Default session lifetime value
private
static int
$defaultLifetime
= 360000
Methods
destroy()
Destroy session
public
static destroy([bool $destoryCookie = true ]) : void
Parameters
- $destoryCookie : bool = true
get()
Return session value or default value if session variable missing
public
static get(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
getEndTime()
Get session end time.
public
static getEndTime() : int
Return values
intgetId()
Get session Id
public
static getId() : string
Return values
stringgetLifetime()
Return session lifetime
public
static getLifetime() : int
Return values
intgetParams()
Get session params
public
static getParams() : array<string|int, mixed>
Return values
array<string|int, mixed>getStartTime()
Get session start time
public
static getStartTime() : int
Return values
intgetStatus()
Get session status
public
static getStatus() : int
Return values
intisActive()
Return true if session is active
public
static isActive() : bool
Return values
boolisStarted()
Return true if session is started
public
static isStarted() : bool
Return values
boolisUseCookies()
Return true if session is stored in cookies
public
static isUseCookies() : bool
Return values
boolrecrete()
Urecreate session
public
static recrete([int|null $lifetime = null ]) : bool
Parameters
- $lifetime : int|null = null
Return values
boolremove()
Remove session value
public
static remove(string $name) : void
Parameters
- $name : string
restart()
Clear all session varibales and start new sesion
public
static restart([int|null $lifetime = null ]) : void
Parameters
- $lifetime : int|null = null
set()
Set value
public
static set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
setLifetime()
Set session lifetime
public
static setLifetime(int $time) : void
Parameters
- $time : int
start()
Start session
public
static start([int|null $lifetime = null ]) : void
Parameters
- $lifetime : int|null = null
toArray()
Get session array
public
static toArray() : array<string|int, mixed>