JSession: Difference between revisions
From Joomla! Documentation
No edit summary |
m clean up |
||
| Line 1: | Line 1: | ||
{{subst:Description:JSession}} | |||
{{Description:JSession}} | |||
===Defined in=== | ===Defined in=== | ||
| Line 76: | Line 73: | ||
<source lang="php">jimport( 'joomla.session.session' );</source> | <source lang="php">jimport( 'joomla.session.session' );</source> | ||
{{subst:SeeAlso:JSession}} | |||
{{SeeAlso:JSession}} | |||
===Examples=== | ===Examples=== | ||
Revision as of 14:22, 24 March 2017
{{subst:Description:JSession}}
Defined in
libraries/joomla/session/session.php
Methods
| Method name | Description |
|---|---|
| __construct | Constructor |
| __destruct | Session object destructor |
| getState | Get current state of session |
| getExpire | Get expiration time in minutes |
| getToken | Get a session token, if a token isn't set yet one will be generated. |
| hasToken | Method to determine if a token exists in the session. If not the session will be set to expired |
| getName | Get session name |
| getId | Get session id |
| getStores | Get the session handlers |
| isNew | Check whether this session is currently created |
| get | Get data from the session store |
| set | Set data into the session store. |
| has | Check wheter data exists in the session store |
| clear | Unset data from the session store |
| destroy | Frees all session variables and destroys all data registered to a session |
| restart | Restart an expired or locked session. |
| fork | Create a new session and copy variables from the old one |
| close | Writes session data and ends session |
| getInstance | Returns the global Session object, only creating it if it doesn't already exist. |
| getFormToken | Method to determine a hash for anti-spoofing variable names |
Importing
jimport( 'joomla.session.session' );
{{subst:SeeAlso:JSession}}
Examples
<CodeExamplesForm />