Session class
Framework\Session\Session
Class Session.
Defined in libraries/session/src/Session.php
Properties #
$options
$saveHandler
$debugCollector
Methods #
- __construct()
- Session constructor.
- __destruct()
- -
- __get()
- -
- __isset()
- -
- __set()
- -
- __unset()
- -
- abort()
- Discard session data changes and end session.
- activate()
- Make sure the session is active.
- destroy()
- Destroys all data registered to a session.
- destroyCookie()
- Sets a Cookie with the session name to be destroyed in the user-agent.
- gc()
- Perform session data garbage collection.
- get()
- Gets one session item.
- getAll()
- Get all session items.
- getFlash()
- Get a Flash Data item.
- getMulti()
- Get multiple session items.
- getTemp()
- Get a Temp Data item.
- has()
- Tells if the session has an item.
- id()
- Get/Set the session id.
- isActive()
- Tells if sessions are enabled, and one exists.
- regenerateId()
- Update the current session id with a newly generated one.
- remove()
- Remove (unset) a session item.
- removeAll()
- Remove (unset) all session items.
- removeFlash()
- Remove a Flash Data item.
- removeMulti()
- Remove (unset) multiple session items.
- removeTemp()
- Remove (unset) a Temp Data item.
- reset()
- Re-initialize session array with original values.
- set()
- Set a session item.
- setDebugCollector()
- -
- setFlash()
- Set a Flash Data item, available only in the next time the session is started.
- setMulti()
- Set multiple session items.
- setTemp()
- Set a Temp Data item.
- start()
- -
- stop()
- Write session data and end session.
- autoRegenerate()
- Auto regenerate the session id.
- clearFlash()
- Clears the Flash Data.
- clearTemp()
- Clears the Temp Data.
- getOptions()
- -
- setOptions()
- -
- setPermanentCookie()
- -
__construct()
Session constructor.
- array $options
- ?\Framework\Session\SaveHandler $handler
__destruct()
__get()
- string $key
__isset()
- string $key
__set()
- string $key
- mixed $value
__unset()
- string $key
abort()
Discard session data changes and end session.
activate()
Make sure the session is active.
If it is not active, it will start it.
destroy()
Destroys all data registered to a session.
destroyCookie()
Sets a Cookie with the session name to be destroyed in the user-agent.
gc()
Perform session data garbage collection.
If return false, use {@see error_get_last()} to get error details.
get()
Gets one session item.
- string $key - The item key name
getAll()
Get all session items.
getFlash()
Get a Flash Data item.
- string $key - The Flash item key name
getMulti()
Get multiple session items.
- array $keys - An array of key item names
getTemp()
Get a Temp Data item.
- string $key - The item key name
has()
Tells if the session has an item.
- string $key - The item key name
id()
Get/Set the session id.
- ?string $newId - [optional] The new session id
isActive()
Tells if sessions are enabled, and one exists.
regenerateId()
Update the current session id with a newly generated one.
- bool $deleteOldSession - Whether to delete the old associated session item or not
remove()
Remove (unset) a session item.
- string $key - The item key name
removeAll()
Remove (unset) all session items.
removeFlash()
Remove a Flash Data item.
- string $key - The item key name
removeMulti()
Remove (unset) multiple session items.
- array $keys - A list of items keys names
removeTemp()
Remove (unset) a Temp Data item.
- string $key - The item key name
reset()
Re-initialize session array with original values.
set()
Set a session item.
- string $key - The item key name
- mixed $value - The item value
setDebugCollector()
- \Framework\Session\Debug\SessionCollector $collector
setFlash()
Set a Flash Data item, available only in the next time the session is started.
- string $key - The Flash Data item key name
- mixed $value - The item value
setMulti()
Set multiple session items.
- array $items - An associative array of items keys and values
setTemp()
Set a Temp Data item.
- string $key - The item key name
- mixed $value - The item value
- int $ttl - The Time-To-Live of the item, in seconds
start()
- array $customOptions
stop()
Write session data and end session.
autoRegenerate()
Auto regenerate the session id.
- int $time
clearFlash()
Clears the Flash Data.
clearTemp()
Clears the Temp Data.
- int $time - The max time to temp data survive
getOptions()
- array $custom
setOptions()
- array $custom
setPermanentCookie()
- int $time