SessionInterface extends JsonSerializable
Tags
Table of Contents
Methods
- all() : array<string, mixed>
- Get all attributes of the session.
- clear() : void
- Remove all attributes from the session.
- forget() : void
- Remove an attribute from the session.
- get() : mixed
- Get a specific attribute from the session.
- getId() : Uuid
- Get the session ID.
- getStore() : SessionStoreInterface
- Get the session store instance.
- has() : bool
- Check if an attribute exists in the session.
- hydrate() : void
- Set all attributes of the session, typically for hydration.
- pull() : mixed
- Get an attribute's value and then remove it from the session.
- save() : bool
- Save the session.
- set() : void
- Set a specific attribute in the session.
Methods
all()
Get all attributes of the session.
public
all() : array<string, mixed>
Return values
array<string, mixed>clear()
Remove all attributes from the session.
public
clear() : void
forget()
Remove an attribute from the session.
public
forget(string $key) : void
Supports dot notation for nested access.
Parameters
- $key : string
get()
Get a specific attribute from the session.
public
get(string $key[, mixed $default = null ]) : mixed
Supports dot notation for nested access.
Parameters
- $key : string
- $default : mixed = null
getId()
Get the session ID.
public
getId() : Uuid
Return values
UuidgetStore()
Get the session store instance.
public
getStore() : SessionStoreInterface
Return values
SessionStoreInterfacehas()
Check if an attribute exists in the session.
public
has(string $key) : bool
Supports dot notation for nested access.
Parameters
- $key : string
Return values
boolhydrate()
Set all attributes of the session, typically for hydration.
public
hydrate(array<string, mixed> $attributes) : void
This will overwrite existing attributes.
Parameters
- $attributes : array<string, mixed>
pull()
Get an attribute's value and then remove it from the session.
public
pull(string $key[, mixed $default = null ]) : mixed
Supports dot notation for nested access.
Parameters
- $key : string
- $default : mixed = null
save()
Save the session.
public
save() : bool
Return values
boolset()
Set a specific attribute in the session.
public
set(string $key, mixed $value[, bool $overwrite = true ]) : void
Supports dot notation for nested access.
Parameters
- $key : string
- $value : mixed
- $overwrite : bool = true