Properties

$_handlerClass

$_handlerClass : string

Session andler class which implements SessionHandlerInterface.

Type

string

$_handlerConfig

$_handlerConfig : null

Parameters of __constructor for session handler class.

Type

null

$_sessionGcProbability

$_sessionGcProbability : int

Session.gc_probability

Type

int

$_sessionGcDivisor

$_sessionGcDivisor : int

Session.gc_divisor

Type

int

$_sessionGcMaxLifeTime

$_sessionGcMaxLifeTime : int

Session.gc_maxlifetime

Type

int

$_data

$_data : array

Session data.

Type

array

$_needSave

$_needSave : bool

Session changed and need to save.

Type

bool

$_sessionId

$_sessionId : null

Session id.

Type

null

Methods

__construct()

__construct(string  $session_id) : mixed

Session constructor.

Parameters

string $session_id

Returns

mixed —

getId()

getId() : string

Get session id.

Returns

string —

get()

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

Get session.

Parameters

string $name
mixed|null $default

Returns

mixed|null —

set()

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

Store data in the session.

Parameters

string $name
mixed $value

Returns

mixed —

delete()

delete(string  $name) : mixed

Delete an item from the session.

Parameters

string $name

Returns

mixed —

pull()

pull(string  $name, mixed|null  $default = null) : mixed|null

Retrieve and delete an item from the session.

Parameters

string $name
mixed|null $default

Returns

mixed|null —

put()

put(string  $key, mixed|null  $value = null) : mixed

Store data in the session.

Parameters

string $key
mixed|null $value

Returns

mixed —

forget()

forget(string  $name) : mixed

Remove a piece of data from the session.

Parameters

string $name

Returns

mixed —

all()

all() : array

Retrieve all the data in the session.

Returns

array —

flush()

flush() : void

Remove all data from the session.

has()

has(string  $name) : bool

Determining If An Item Exists In The Session.

Parameters

string $name

Returns

bool —

exists()

exists(string  $name) : bool

To determine if an item is present in the session, even if its value is null.

Parameters

string $name

Returns

bool —

save()

save() : void

Save session to store.

init()

init() : void

Init.

handlerClass()

handlerClass(mixed|null  $class_name = null, mixed|null  $config = null) : string

Set session handler class.

Parameters

mixed|null $class_name
mixed|null $config

Returns

string —

tryGcSessions()

tryGcSessions() : void

Try GC sessions.

__destruct()

__destruct() : void

__destruct.

initHandler()

initHandler() : void

Init handler.

checkSessionId()

checkSessionId(string  $session_id) : mixed

Check session id.

Parameters

string $session_id

Returns

mixed —