Documentation

SessionModelInterface

Interface for session management models.

Defines the contract for storing and retrieving user session data.

Table of Contents

Methods

get()  : stdClass|mixed|null
Get session data.
isset()  : bool
Check if a user session exists.
set()  : string
Set session data.
unset()  : string
Destroy the current user session.

Methods

get()

Get session data.

public static get([string|null $field = null ]) : stdClass|mixed|null
Parameters
$field : string|null = null

Field name to retrieve. Null returns all data.

Return values
stdClass|mixed|null

All session data, a single field value, or null if no session.

isset()

Check if a user session exists.

public static isset() : bool
Return values
bool

True if session data is set.

set()

Set session data.

public static set(string $id[, mixed $value = null ]) : string

With one argument, loads full user data into session. With two arguments, updates a single session field.

Parameters
$id : string

User ID (1 arg) or field name (2 args).

$value : mixed = null

Field value when updating a single field.

Return values
string

Called class name for method chaining.

unset()

Destroy the current user session.

public static unset() : string
Return values
string

Called class name for method chaining.


        
On this page

Search results