class Session implements CollectionInterface (View source)

Constants

CORE_SESSION_KEY

The internal session variable

Methods

static Session
configure(array $config)

Configure session instance

static Session|null
getInstance()

Get session singleton

void
regenerate()

Generate session

void
flush()

Allows you to empty the session

bool
start()

Session starter.

bool
exists(string $key)

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

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

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

bool
isEmpty()

Check whether a collection is empty.

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

Retrieves a value or value collection.

mixed
flash(string|int $key, string|null $message = null)

Add flash data After the data recovery is automatic deleted

mixed
put(string|int $key, mixed $value, $next = false)

The add alias

mixed
add(string|int $key, mixed $data, bool $next = false)

Add an entry to the collection

array
all()

Returns the list of session variables

mixed
remove(string|int $key)

Delete an entry in the collection

mixed
set(string $key, mixed $value)

set

array
toArray()

Returns the list of session data as an array.

void
clearFlash()

Empty the flash system.

void
clear()

Allows to clear the cache except csrf and __bow.flash

array
toObject()

Returns the list of session data as a toObject.

string
__toString()

__toString

Details

static Session configure(array $config)

Configure session instance

Parameters

array $config

Return Value

Session

Exceptions

SessionException

static Session|null getInstance()

Get session singleton

Return Value

Session|null

void regenerate()

Generate session

Return Value

void

Exceptions

SessionException

void flush()

Allows you to empty the session

Return Value

void

bool start()

Session starter.

Return Value

bool

Exceptions

SessionException

bool exists(string $key)

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

Parameters

string $key

Return Value

bool

Exceptions

SessionException

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

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

Parameters

string|int $key
bool $strict

Return Value

bool

Exceptions

SessionException

bool isEmpty()

Check whether a collection is empty.

Return Value

bool

Exceptions

SessionException

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

Retrieves a value or value collection.

Parameters

mixed $key
mixed $default

Return Value

mixed

Exceptions

SessionException

mixed flash(string|int $key, string|null $message = null)

Add flash data After the data recovery is automatic deleted

Parameters

string|int $key
string|null $message

Return Value

mixed

Exceptions

SessionException

mixed put(string|int $key, mixed $value, $next = false)

The add alias

Parameters

string|int $key
mixed $value
$next

Return Value

mixed

Exceptions

SessionException

See also

Session::add

mixed add(string|int $key, mixed $data, bool $next = false)

Add an entry to the collection

Parameters

string|int $key
mixed $data
bool $next

Return Value

mixed

Exceptions

SessionException

array all()

Returns the list of session variables

Return Value

array

Exceptions

SessionException

mixed remove(string|int $key)

Delete an entry in the collection

Parameters

string|int $key

Return Value

mixed

Exceptions

SessionException

mixed set(string $key, mixed $value)

set

Parameters

string $key
mixed $value

Return Value

mixed

Exceptions

SessionException

array toArray()

Returns the list of session data as an array.

Return Value

array

Exceptions

SessionException

void clearFlash()

Empty the flash system.

Return Value

void

Exceptions

SessionException

void clear()

Allows to clear the cache except csrf and __bow.flash

Return Value

void

Exceptions

SessionException

array toObject()

Returns the list of session data as a toObject.

Return Value

array

string __toString()

__toString

Return Value

string

Exceptions

SessionException