\Omega\Session\Storage NativeStorage

Native driver class.

The NativeStorage provides native session storage using PHP's built-in session handling.

Summary

Methods
Properties
Constants
__construct
has
get
put
forget
flush
No public properties found
No public constants found
No protected methods found
No protected properties found
No protected constants found
No private methods found
config
prefix
No private constants found

Properties

$config

$config : array

Configuration array.

Type

array<string, mixed> — Holds an array of configuration parameters.

$prefix

$prefix : string

The session prefix.

Type

string — Holds the session prefix.

Methods

__construct()

__construct(array  $config) : void

NativeStorage constructor.

Parameters

array $config

Holds an array of configuration parameters.

Returns

void —

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 —