Joomla CMS
3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
|
Fonctions membres publiques | |
__construct ($store='none', array $options=array(), \JSessionHandlerInterface $handlerInterface=null) | |
__get ($name) | |
getState () | |
getExpire () | |
getToken ($forceNew=false) | |
hasToken ($tCheck, $forceExpire=true) | |
getIterator () | |
getName () | |
getId () | |
getData () | |
isActive () | |
isNew () | |
initialise (Input $input, \JEventDispatcher $dispatcher=null) | |
get ($name, $default=null, $namespace='default') | |
set ($name, $value=null, $namespace='default') | |
has ($name, $namespace='default') | |
clear ($name, $namespace='default') | |
start () | |
destroy () | |
restart () | |
fork () | |
close () | |
gc () | |
setHandler (\JSessionHandlerInterface $handler) | |
Fonctions membres publiques statiques | |
static | getInstance ($store, $options, \JSessionHandlerInterface $handlerInterface=null) |
static | getFormToken ($forceNew=false) |
static | checkToken ($method='post') |
static | getStores () |
Fonctions membres protégées | |
_start () | |
_createToken ($length=32) | |
_setCounter () | |
_setTimers () | |
_setOptions (array $options) | |
_validate ($restart=false) | |
Attributs protégés | |
$_state = 'inactive' | |
$_expire = 900 | |
$_store = null | |
$_security = array('fix_browser') | |
$storeName | |
$_handler = null | |
$data | |
Attributs protégés statiques | |
static | $instance |
Attributs privés | |
$_input = null | |
$_dispatcher = null | |
Class for managing HTTP sessions
Provides access to session-state values as well as session-level settings and lifetime management methods. Based on the standard PHP session handling mechanism it provides more advanced features such as expire timeouts.
__construct | ( | $store = 'none' , |
|
array | $options = array() , |
||
\JSessionHandlerInterface | $handlerInterface = null |
||
) |
Constructor
string | $store | The type of storage for the session. |
array | $options | Optional parameters |
\JSessionHandlerInterface | $handlerInterface | The session handler |
Références $options, et Session\_setOptions().
__get | ( | $name | ) |
Magic method to get read-only access to properties.
string | $name | Name of property to retrieve |
Références $name.
|
protected |
Create a token-string
integer | $length | Length of string |
Références UserHelper\genRandomPassword().
Référencé par Session\getToken().
|
protected |
Set counter of session usage
Références $counter.
Référencé par Session\restart(), et Session\start().
|
protected |
Set additional session options
array | $options | List of parameter |
Références $options.
Référencé par Session\__construct().
|
protected |
Set the session timers
Références $start, et Session\has().
Référencé par Session\start().
|
protected |
Start a session.
Creates a session (or resumes the current one based on the state of the session)
Finally, empty the __default key since we no longer need it. Don't unset it completely, we need this for the administrator/components/com_admin/script.php to detect upgraded sessions and perform a full session cleanup.
Références Session\$data, et null.
Référencé par Session\restart(), et Session\start().
|
protected |
Do some checks for security reason
If one check failed, session data has to be cleaned.
boolean | $restart | Reactivate session |
Références elseif, Session\getExpire(), et null.
Référencé par Session\restart(), et Session\start().
|
static |
Checks for a form token in the request.
Use in conjunction with ::_('form.token') or Session::getFormToken.
string | $method | The request method in which to look for the token key. |
Références $app.
clear | ( | $name, | |
$namespace = 'default' |
|||
) |
Unset data from the session store
string | $name | Name of variable |
string | $namespace | Namespace to use, default to 'default' |
Références $name, Session\getState(), Session\isActive(), null, et Session\start().
close | ( | ) |
Writes session data and ends session
Session data is usually stored after your script terminated without the need to call Session::close(), but as session data is locked to prevent concurrent writes only one script may operate on a session at any time. When using framesets together with sessions you will experience the frames loading one by one due to this locking. You can reduce the time needed to load all the frames by ending the session as soon as all changes to session variables are done.
destroy | ( | ) |
Frees all session variables and destroys all data registered to a session
This method resets the data pointer and destroys all of the data associated with the current session in its storage. It forces a new session to be started after this method is called. It does not unset the session cookie.
Références Session\getState().
Référencé par Session\restart(), et Session\start().
fork | ( | ) |
Create a new session and copy variables from the old one
Références Session\getState(), et null.
gc | ( | ) |
Delete expired session data
Références Session\getExpire().
get | ( | $name, | |
$default = null , |
|||
$namespace = 'default' |
|||
) |
Get data from the session store
string | $name | Name of a variable |
mixed | $default | Default value of a variable if not set |
string | $namespace | Namespace to use, default to 'default' |
Références $default, $name, Session\getState(), Session\isActive(), null, et Session\start().
Référencé par MetadataManager\createRecordIfNonExisting().
getData | ( | ) |
Returns a clone of the internal data pointer
Références Session\$data.
Référencé par Session\getIterator().
getExpire | ( | ) |
Get expiration time in seconds
Références Session\$_expire.
Référencé par Session\_validate(), et Session\gc().
|
static |
Method to determine a hash for anti-spoofing variable names
boolean | $forceNew | If true, force a new token to be created |
Références $user, et ApplicationHelper\getHash().
Référencé par ContenthistoryField\getLayoutData(), et ModuleorderField\getLayoutData().
getId | ( | ) |
Get session id
Références Session\getState().
Référencé par MetadataManager\createRecordIfNonExisting().
|
static |
Returns the global Session object, only creating it if it doesn't already exist.
string | $store | The type of storage for the session. |
array | $options | An array of configuration options. |
\JSessionHandlerInterface | $handlerInterface | The session handler |
Références $options.
Référencé par Factory\createSession().
getIterator | ( | ) |
getName | ( | ) |
getState | ( | ) |
Get current state of session
Références Session\$_state.
Référencé par Session\clear(), Session\destroy(), Session\fork(), Session\get(), Session\getId(), Session\getName(), Session\has(), Session\isActive(), Session\restart(), Session\set(), et Session\start().
|
static |
Get the session handlers
$file
Références $class, $file, et JPATH_LIBRARIES.
getToken | ( | $forceNew = false | ) |
Get a session token, if a token isn't set yet one will be generated.
Tokens are used to secure forms from spamming attacks. Once a token has been generated the system will check the post request to see if it is present, if not it will invalidate the session.
boolean | $forceNew | If true, force a new token to be created |
Références Session\_createToken(), et null.
has | ( | $name, | |
$namespace = 'default' |
|||
) |
Check whether data exists in the session store
string | $name | Name of variable |
string | $namespace | Namespace to use, default to 'default' |
Références $name, Session\getState(), Session\isActive(), null, et Session\start().
Référencé par Session\_setTimers().
hasToken | ( | $tCheck, | |
$forceExpire = true |
|||
) |
Method to determine if a token exists in the session. If not the session will be set to expired
string | $tCheck | Hashed token to be verified |
boolean | $forceExpire | If true, expires the session |
initialise | ( | Input | $input, |
\JEventDispatcher | $dispatcher = null |
||
) |
Check whether this session is currently created
Input | $input | Input object for the session to use. |
\JEventDispatcher | $dispatcher | Dispatcher object for the session to use. |
Références $dispatcher, et $input.
isActive | ( | ) |
Shorthand to check if the session is active
Références Session\getState().
Référencé par Session\clear(), Session\get(), Session\has(), et Session\set().
isNew | ( | ) |
Check whether this session is currently created
Référencé par MetadataManager\createRecordIfNonExisting().
restart | ( | ) |
Restart an expired or locked session.
Destroy the session if it's not valid - we can't restart the session here unlike in the start method else we risk recursion.
Références Session\_setCounter(), Session\_start(), Session\_validate(), Session\destroy(), Session\getState(), et null.
Référencé par Session\start().
set | ( | $name, | |
$value = null , |
|||
$namespace = 'default' |
|||
) |
Set data into the session store.
string | $name | Name of a variable. |
mixed | $value | Value of a variable. |
string | $namespace | Namespace to use, default to 'default'. |
Références $name, $prev, $value, Session\getState(), Session\isActive(), null, et Session\start().
setHandler | ( | \JSessionHandlerInterface | $handler | ) |
Set the session handler
\JSessionHandlerInterface | $handler | The session handler |
start | ( | ) |
Start a session.
Références Session\_setCounter(), Session\_setTimers(), Session\_start(), Session\_validate(), Session\destroy(), Session\getState(), et Session\restart().
Référencé par Session\clear(), Session\get(), Session\has(), et Session\set().
|
private |
|
protected |
Référencé par Session\getExpire().
|
protected |
|
private |
|
protected |
|
protected |
Référencé par Session\getState().
|
protected |
|
protected |
Référencé par Session\_start(), et Session\getData().
|
staticprotected |
|
protected |