NativeStorage
Implements StorageInterfaceBase class providing a session store
since |
2.0.0 |
---|---|
package |
Joomla Framework |
Methods
__construct
Constructor
__construct(\SessionHandlerInterface handler = null, array options = []) : mixed
since |
1.0 |
---|
Arguments
- handler
\SessionHandlerInterface
Session save handler- options
array
Session options
Response
mixed
abort
Aborts the current session
abort() : bool
see | session_abort() |
---|---|
since |
2.0.0 |
Response
bool
all
Retrieves all variables from the session store
all() : array
since |
2.0.0 |
---|
Response
array
clear
Clears all variables from the session store
clear() : void
since |
2.0.0 |
---|
close
Writes session data and ends session
close() : void
see | session_write_close() |
---|---|
since |
2.0.0 |
gc
Perform session data garbage collection
gc() : int|bool
see | session_gc() |
---|---|
since |
2.0.0 |
Response
int|bool
Number of deleted sessions on success or boolean false on failure or if the function is unsupported
get
Get data from the session store
get(string name, mixed default) : mixed
since |
2.0.0 |
---|
Arguments
- name
string
Name of a variable- default
mixed
Default value of a variable if not set
Response
mixed
Value of a variable
getHandler
Gets the save handler instance
getHandler() : \SessionHandlerInterface|null
since |
2.0.0 |
---|
Response
\SessionHandlerInterface|null
getId
Get the session ID
getId() : string
since |
2.0.0 |
---|
Response
string
The session ID
getName
Get the session name
getName() : string
since |
2.0.0 |
---|
Response
string
The session name
has
Check whether data exists in the session store
has(string name) : bool
since |
2.0.0 |
---|
Arguments
- name
string
Name of variable
Response
bool
isActive
Check if the session is active
isActive() : bool
since |
2.0.0 |
---|
Response
bool
isStarted
Check if the session is started
isStarted() : bool
since |
2.0.0 |
---|
Response
bool
regenerate
Regenerates the session ID that represents this storage.
regenerate(bool destroy = false) : bool
This method must invoke session_regenerate_id($destroy) unless this interface is used for a storage object designed for unit or functional testing where a real PHP session would interfere with testing.
see | session_regenerate_id() |
---|---|
since |
2.0.0 |
Arguments
- destroy
bool
Destroy session when regenerating?
Response
bool
True on success
remove
Unset a variable from the session store
remove(string name) : mixed
since |
2.0.0 |
---|
Arguments
- name
string
Name of variable
Response
mixed
The value from session or NULL if not set
set
Set data into the session store
set(string name, mixed value = null) : mixed
since |
2.0.0 |
---|
Arguments
- name
string
Name of a variable- value
mixed
Value of a variable
Response
mixed
Old value of a variable
setHandler
Registers session save handler as a PHP session handler
setHandler(\SessionHandlerInterface handler = null) : $this
since |
2.0.0 |
---|---|
throws |
|
Arguments
- handler
\SessionHandlerInterface
The save handler to use
Response
$this
setId
Set the session ID
setId(string id) : $this
since |
2.0.0 |
---|---|
throws |
|
Arguments
- id
string
The session ID
Response
$this
setName
Set the session name
setName(string name) : $this
since |
2.0.0 |
---|---|
throws |
|
Arguments
- name
string
The session name
Response
$this
setOptions
Sets session.* ini variables.
setOptions(array options) : $this
For convenience we omit 'session.' from the beginning of the keys. Explicitly ignores other ini keys.
note |
Based on \Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage::setOptions() |
---|---|
see |
http://php.net/session.configuration |
since |
2.0.0 |
Arguments
- options
array
Session ini directives array(key => value).
Response
$this
start
Start a session
start() : void
since |
2.0.0 |
---|
Properties
active
Flag if the session is active
since |
2.0.0 |
---|
Type(s)
bool
closed
Internal flag identifying whether the session has been closed
since |
2.0.0 |
---|
Type(s)
bool
handler
Session save handler
since |
2.0.0 |
---|
Type(s)
\SessionHandlerInterface
started
Internal flag identifying whether the session has been started
since |
2.0.0 |
---|
Type(s)
bool