SessionInterface
extends
IteratorAggregate
in
Class Session
Tags
Table of Contents
Methods
- __get() : mixed
- Returns session variable.
- __isset() : bool
- Checks if session variable is defined.
- __set() : void
- Sets session variable.
- __unset() : void
- Removes session variable.
- clear() : $this
- Free all session variables.
- close() : $this
- Force the session to be saved and closed
- getAll() : array<string|int, mixed>
- Returns all session variables.
- getId() : string|null
- Get session ID
- getInstance() : Session
- Get current session instance.
- getIterator() : ArrayIterator
- Retrieve an external iterator
- getName() : string|null
- Get session name
- invalidate() : $this
- Invalidates the current session.
- isStarted() : bool
- Checks if the session was started.
- setId() : $this
- Set session ID
- setName() : $this
- Set session name
- setOptions() : void
- Sets session.* ini variables.
- start() : $this
- Starts the session storage
Methods
__get()
Returns session variable.
public
__get(string $name) : mixed
Parameters
- $name : string
Attributes
- #[ReturnTypeWillChange]
__isset()
Checks if session variable is defined.
public
__isset(string $name) : bool
Parameters
- $name : string
Attributes
- #[ReturnTypeWillChange]
Return values
bool__set()
Sets session variable.
public
__set(string $name, mixed $value) : void
Parameters
- $name : string
- $value : mixed
Attributes
- #[ReturnTypeWillChange]
__unset()
Removes session variable.
public
__unset(string $name) : void
Parameters
- $name : string
Attributes
- #[ReturnTypeWillChange]
clear()
Free all session variables.
public
clear() : $this
Return values
$thisclose()
Force the session to be saved and closed
public
close() : $this
Return values
$thisgetAll()
Returns all session variables.
public
getAll() : array<string|int, mixed>
Return values
array<string|int, mixed>getId()
Get session ID
public
getId() : string|null
Return values
string|null —Session ID
getInstance()
Get current session instance.
public
static getInstance() : Session
Tags
Return values
SessiongetIterator()
Retrieve an external iterator
public
getIterator() : ArrayIterator
Tags
Attributes
- #[ReturnTypeWillChange]
Return values
ArrayIterator —Return an ArrayIterator of $_SESSION
getName()
Get session name
public
getName() : string|null
Return values
string|nullinvalidate()
Invalidates the current session.
public
invalidate() : $this
Return values
$thisisStarted()
Checks if the session was started.
public
isStarted() : bool
Return values
boolsetId()
Set session ID
public
setId(string $id) : $this
Parameters
- $id : string
-
Session ID
Return values
$thissetName()
Set session name
public
setName(string $name) : $this
Parameters
- $name : string
Return values
$thissetOptions()
Sets session.* ini variables.
public
setOptions(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
Tags
start()
Starts the session storage
public
start([bool $readonly = false ]) : $this
Parameters
- $readonly : bool = false