Session
Table of Contents
- __construct() : void
- __Construct.
- delete() : mixed
- Delete/unset the session.
- deleteMultiple() : void
- Delete multiple values in session.
- destroy() : void
- Destroy the session.
- get() : string
- Get the session value by providing session name.
- getMultiple() : array<string|int, mixed>
- Get multiple values in session.
- has() : bool
- Check if session is already set with specific name.
- sessionPath() : void
- Change session path.
- set() : string
- Set/store value in session.
- setMultiple() : object
- Set/store multiple values in session.
- start() : void
- Start the session if not already start.
Methods
__construct()
__Construct.
public
__construct() : void
Tags
Return values
void —delete()
Delete/unset the session.
public
static delete((string) $name) : mixed
Parameters
- $name : (string)
-
name of session e.g users
Tags
Return values
mixed —deleteMultiple()
Delete multiple values in session.
public
deleteMultiple((array) $keys) : void
Parameters
- $keys : (array)
-
keys
Tags
Return values
void —destroy()
Destroy the session.
public
static destroy() : void
Tags
Return values
void —get()
Get the session value by providing session name.
public
static get((string) $name[, (mixed) $default = null ]) : string
Parameters
- $name : (string)
-
name of session e.g users
- $default : (mixed) = null
-
default value if sesion is not exists
Tags
Return values
string —getMultiple()
Get multiple values in session.
public
getMultiple((array) $keys) : array<string|int, mixed>
Parameters
- $keys : (array)
-
keys
Tags
Return values
array<string|int, mixed> —has()
Check if session is already set with specific name.
public
static has((string) $name) : bool
Parameters
- $name : (string)
-
name of session e.g users
Tags
Return values
bool —sessionPath()
Change session path.
public
static sessionPath() : void
Tags
Return values
void —set()
Set/store value in session.
public
static set((string) $name, (string) $value) : string
Parameters
- $name : (string)
-
name of session e.g users
- $value : (string)
-
value store in session e.g user token
Tags
Return values
string —setMultiple()
Set/store multiple values in session.
public
setMultiple((array) $values) : object
Parameters
- $values : (array)
-
keys and values
Tags
Return values
object —start()
Start the session if not already start.
public
static start() : void