\Omega\Session\Storage StorageInterface

Storage interface.

The StorageInterface defines the contract for session storage implementations. It provides methods for checking, retrieving, storing, and removing session values.

Summary

Methods
Constants
has()
get()
put()
forget()
flush()
No public constants found

Methods

has()

has(string  $key) : bool

Check if a session value exists.

Parameters

string $key

The session key.

Returns

bool —

Return true if the session value exists.

get()

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

Get a session value.

Parameters

string $key

The session key.

mixed $default

The default value to return if the key is not found.

Returns

mixed —

Return the session value or the default value if the key is not found.

put()

put(string  $key, mixed  $value) : $this

Store a value in the session.

Parameters

string $key

The session key.

mixed $value

The session value.

Returns

$this —

forget()

forget(string  $key) : $this

Remove a single session value.

Parameters

string $key

The session key.

Returns

$this —

flush()

flush() : $this

Remove all session values.

Returns

$this —