class Session implements CollectionInterface (View source)

Constants

CORE_SESSION_KEY

The internal session variable

Methods

static mixed
configure(array $config)

Configure session instance

static mixed
getInstance()

Get session singleton

bool
start()

Session starter.

regenerate()

Generate session

bool
has(string $key, bool $strict = false)

Allows checking for the existence of a key in the session collection

bool
exists(string $key)

Allows checking for the existence of a key in the session collection

bool
isEmpty()

Check whether a collection is empty.

mixed
get(string $key, mixed $default = null)

Retrieves a value or value collection.

add(string $key, mixed $value, bool $next = false)

Add an entry to the collection

put($key, $value, $next = false)

The add alias

array
all()

Returns the list of session variables

remove(string $key)

Delete an entry in the collection

set(string $key, mixed $value)

set

mixed
flash(mixed $key, mixed $message = null)

Add flash data After the data recovery is automatic deleted

array
toArray()

Returns the list of session data as a array.

clearFash()

Empty the flash system.

clear()

Allows to clear the cache except csrf and __bow.flash

flush()

Allows you to empty the session

array
toObject()

Returns the list of session data as a toObject.

string
__toString()

__toString

Details

static mixed configure(array $config)

Configure session instance

Parameters

array $config

Return Value

mixed

static mixed getInstance()

Get session singleton

Return Value

mixed

bool start()

Session starter.

Return Value

bool

regenerate()

Generate session

bool has(string $key, bool $strict = false)

Allows checking for the existence of a key in the session collection

Parameters

string $key
bool $strict

Return Value

bool

bool exists(string $key)

Allows checking for the existence of a key in the session collection

Parameters

string $key

Return Value

bool

bool isEmpty()

Check whether a collection is empty.

Return Value

bool

mixed get(string $key, mixed $default = null)

Retrieves a value or value collection.

Parameters

string $key
mixed $default

Return Value

mixed

CollectionInterface add(string $key, mixed $value, bool $next = false)

Add an entry to the collection

Parameters

string $key
mixed $value
bool $next

Return Value

CollectionInterface

Exceptions

InvalidArgumentException

put($key, $value, $next = false)

The add alias

Parameters

$key
$value
$next

See also

Session::add

array all()

Returns the list of session variables

Return Value

array

CollectionInterface remove(string $key)

Delete an entry in the collection

Parameters

string $key

Return Value

CollectionInterface

CollectionInterface set(string $key, mixed $value)

set

Parameters

string $key
mixed $value

Return Value

CollectionInterface

mixed flash(mixed $key, mixed $message = null)

Add flash data After the data recovery is automatic deleted

Parameters

mixed $key
mixed $message

Return Value

mixed

array toArray()

Returns the list of session data as a array.

Return Value

array

clearFash()

Empty the flash system.

clear()

Allows to clear the cache except csrf and __bow.flash

flush()

Allows you to empty the session

array toObject()

Returns the list of session data as a toObject.

Return Value

array

string __toString()

__toString

Return Value

string