final class NativeSession implements SessionInterface (View source)

Delegates the public session contract to the configured storage implementation

Methods

Connects the facade to the configured session storage implementation

void
start()

Starts the delegated storage before any values are read or written

void
bool

Reports the delegated storage initialization state

bool
bool
has(string $key)

Checks the delegated storage for a value under the key

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

Reads a delegated value or returns the supplied fallback

mixed
void
set(string $key, mixed $value)

Persists a delegated value under the key

void
void
remove(string $key)

Removes a delegated value under the key

void
void
clear()

Clears all values held by the delegated storage

void
void

Destroys the delegated identity and permits a later access to start a new one.

void
void
regenerate(bool $deleteOldSession = true)

Regenerates the identifier through the delegated storage implementation

void

Details

__construct

__construct(SessionStorageInterface $storage)

Connects the facade to the configured session storage implementation

Parameters

SessionStorageInterface $storage

start

void start()

Starts the delegated storage before any values are read or written

Return Value

void

started

bool started()

Reports the delegated storage initialization state

Return Value

bool

has

bool has(string $key)

Checks the delegated storage for a value under the key

Parameters

string $key

Return Value

bool

get

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

Reads a delegated value or returns the supplied fallback

Parameters

string $key
mixed $default

Return Value

mixed

set

void set(string $key, mixed $value)

Persists a delegated value under the key

Parameters

string $key
mixed $value

Return Value

void

remove

void remove(string $key)

Removes a delegated value under the key

Parameters

string $key

Return Value

void

clear

void clear()

Clears all values held by the delegated storage

Return Value

void

destroy

void destroy()

Destroys the delegated identity and permits a later access to start a new one.

Return Value

void

regenerate

void regenerate(bool $deleteOldSession = true)

Regenerates the identifier through the delegated storage implementation

Parameters

bool $deleteOldSession

Return Value

void