SessionBag
extends
AttributeBag
in
PHP Mini Framework
Tags
Table of Contents
- all() : array<string|int, mixed>
- Get all attributes
- clear() : void
- Remove all attribute
- destroy() : bool
- Destroy session
- get() : mixed
- Get attribute
- getId() : string
- Gets the session ID.
- getName() : string
- Gets the session name.
- has() : bool
- Checks if an attribute exists
- pull() : mixed
- Pull attribute: Get and delete
- regenerate() : bool
- Regenerate session ID
- remove() : void
- Remove attribute
- replace() : void
- Set bulk attributes
- set() : bool
- Set attribute
- setId() : void
- Sets the session ID.
- start() : bool
- Start session
- touch() : void
- Touch session to update last access date
Methods
all()
Get all attributes
public
all() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —clear()
Remove all attribute
public
clear() : void
Tags
Return values
void —destroy()
Destroy session
public
destroy() : bool
Tags
Return values
bool —get()
Get attribute
public
get(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
Tags
Return values
mixed —getId()
Gets the session ID.
public
getId() : string
Tags
Return values
string —getName()
Gets the session name.
public
getName() : string
Tags
Return values
string —has()
Checks if an attribute exists
public
has(string $name) : bool
Parameters
- $name : string
Tags
Return values
bool —pull()
Pull attribute: Get and delete
public
pull(string $name[, mixed $default = null ]) : mixed
Parameters
- $name : string
- $default : mixed = null
Tags
Return values
mixed —regenerate()
Regenerate session ID
public
regenerate([bool $deleteOld = false ]) : bool
Parameters
- $deleteOld : bool = false
Tags
Return values
bool —remove()
Remove attribute
public
remove(string $name) : void
Parameters
- $name : string
Tags
Return values
void —replace()
Set bulk attributes
public
replace(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
Tags
Return values
void —set()
Set attribute
public
set(string $name, mixed $value[, mixed $options = NULL ]) : bool
Parameters
- $name : string
- $value : mixed
- $options : mixed = NULL
Tags
Return values
bool —setId()
Sets the session ID.
public
setId(string $sessionId) : void
Parameters
- $sessionId : string
Tags
Return values
void —start()
Start session
public
start() : bool
Tags
Return values
bool —touch()
Touch session to update last access date
public
touch(string $name) : void
Parameters
- $name : string