Pickles Framework Documentation

PhpNativeSessionStorage implements SessionStorage

Class PhpNativeSessionStorage

This class implements the SessionStorage interface and provides session storage functionality using PHP's native session handling.

Table of Contents

Interfaces

SessionStorage
Interface SessionStorage

Methods

destroy()  : bool
Destroys the current session and clears all session data.
get()  : mixed
Retrieves a value from the session storage by its key.
has()  : bool
Checks if a specific key exists in the session storage.
id()  : string
Retrieves the current session ID.
remove()  : void
Removes a value from the session storage.
save()  : bool
Saves the current session data to the storage.
set()  : void
Stores a value in the session storage with the specified key.
start()  : void
Starts the session storage mechanism.

Methods

destroy()

Destroys the current session and clears all session data.

public destroy() : bool
Tags
inheritDoc
Return values
bool

Returns true on success or false on failure.

get()

Retrieves a value from the session storage by its key.

public get(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string

The key associated with the value to retrieve.

$default : mixed = null

The default value to return if the key does not exist. Defaults to null.

Tags
inheritDoc
Return values
mixed

The value associated with the given key, or the default value if the key does not exist.

has()

Checks if a specific key exists in the session storage.

public has(string $key) : bool
Parameters
$key : string

The key to check for existence in the session storage.

Tags
inheritDoc
Return values
bool

Returns true if the key exists, false otherwise.

id()

Retrieves the current session ID.

public id() : string
Tags
inheritDoc
Return values
string

The session ID.

remove()

Removes a value from the session storage.

public remove(string $key) : void
Parameters
$key : string

The key identifying the value to be removed.

Tags
inheritDoc

save()

Saves the current session data to the storage.

public save() : bool
Tags
inheritDoc
Return values
bool

Returns true on success or false on failure.

set()

Stores a value in the session storage with the specified key.

public set(string $key, mixed $value) : void
Parameters
$key : string

The key under which the value will be stored.

$value : mixed

The value to store in the session storage.

Tags
inheritDoc

        
On this page

Search results