Constants

AUTH_CONTAINER_NAME

AUTH_CONTAINER_NAME

Auth container will be reset on logout

LAST_ACCESS

LAST_ACCESS

Constant used to hold the session last access time

Properties

$_initialized

$_initialized : 

Type

$_data

$_data : array

Data

Type

array

$_sessionNamespace

$_sessionNamespace : integer|string

Namespace

Type

integer|string

$_sessionNamespacePrefix

$_sessionNamespacePrefix : 

Type

$_modified

$_modified : boolean

True when {@link Fuman_Session} was modified and not saved

Type

boolean

$_isDaemonSession

$_isDaemonSession : 

Type

$_daemonSessions

$_daemonSessions : 

Type

Methods

__construct()

__construct(string|null  $sessionNamespacePrefix = null, boolean  $isDaemonSession = false) 

Constructor

Parameters

string|null $sessionNamespacePrefix
boolean $isDaemonSession

(Daemon session are synced for written, closed, deleted, regenerated with main session)

init()

init() : void

Initializes the {@link Fuman_Session}

getId()

getId() : string

Get session id

Returns

string

getExpire()

getExpire() : integer

Get session expire (in minutes)

Returns

integer

read()

read() : void

Reads the Session Data From Storage and distributes itself to all added Customers

write()

write() : void

Collects Data from added {@link Fuman_Session_Customer_Interface} and saves it in {@link Fuman_Session_Storage_Interface}

delete()

delete() : void

Deletes session

regenerateId()

regenerateId() : void

Regenerates the Session id and informs the {@link Fuman_Session_Storage_Interface}.

Throws

\Fuman_Exception

updateLastAccess()

updateLastAccess() : void

Updates last access time

close()

close() : void

Close session (Only used for long request execution)

getContainer()

getContainer(string  $name, boolean  $auth_container = false) : object

Creates a container (stdClass) in the session The container is linked by reference, so you can change data in the container when ever you want to.

If $auth_container is true, the container will be automatically reset on logout

Parameters

string $name

container name

boolean $auth_container

Put the container into the auth_container

Throws

\Fuman_Exception

Returns

object

removeContainer()

removeContainer(string  $name) 

Removes container from session

Parameters

string $name

logOut()

logOut() : void

Resets the auth container

getValue()

getValue(string  $key) : mixed

Returns null when value is not available.

Parameters

string $key

Returns

mixed

hasValue()

hasValue(string  $key) : boolean

Has value

Parameters

string $key

Returns

boolean

setValue()

setValue(string  $key, mixed  $value) : void

When setting a value. Modified will be set as true

Parameters

string $key
mixed $value