Difference between revisions of "JSession"
From Joomla! Documentation
(Bulk upload by Doxiki2) |
m (moving preparation) |
||
(5 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
__NOTOC__ | __NOTOC__ | ||
+ | =={{JVer|11.1}} JSession== | ||
+ | ===Description=== | ||
+ | {{Description:JSession}} | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[</nowiki>[[Description:JSession|Edit Descripton]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[Description:JSession|Edit Descripton]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
===Methods=== | ===Methods=== | ||
{| class="wikitable sortable" | {| class="wikitable sortable" | ||
|- | |- | ||
+ | !Visibility | ||
!Method name | !Method name | ||
!Description | !Description | ||
|- | |- | ||
− | |[[JSession::__construct | + | |public |
+ | |[[API17:JSession::__construct|__construct]] | ||
|Constructor. | |Constructor. | ||
|- | |- | ||
− | |[[JSession::__destruct | + | |public |
+ | |[[API17:JSession::__destruct|__destruct]] | ||
|Session object destructor. | |Session object destructor. | ||
|- | |- | ||
− | |[[JSession::clear | + | |public |
+ | |[[API17:JSession::clear|clear]] | ||
|Unset data from the session store. | |Unset data from the session store. | ||
|- | |- | ||
− | |[[JSession::close | + | |public |
+ | |[[API17:JSession::close|close]] | ||
|Writes session data and ends session. | |Writes session data and ends session. | ||
|- | |- | ||
− | |[[JSession::destroy | + | |public |
+ | |[[API17:JSession::destroy|destroy]] | ||
|Frees all session variables and destroys all data registered to a session. | |Frees all session variables and destroys all data registered to a session. | ||
|- | |- | ||
− | |[[JSession::fork | + | |public |
+ | |[[API17:JSession::fork|fork]] | ||
|Create a new session and copy variables from the old one. | |Create a new session and copy variables from the old one. | ||
|- | |- | ||
− | |[[JSession::get | + | |public |
+ | |[[API17:JSession::get|get]] | ||
|Get data from the session store. | |Get data from the session store. | ||
|- | |- | ||
− | |[[JSession::getExpire | + | |public |
+ | |[[API17:JSession::getExpire|getExpire]] | ||
|Get expiration time in minutes. | |Get expiration time in minutes. | ||
|- | |- | ||
− | |[[JSession::getId | + | |public |
+ | |[[API17:JSession::getId|getId]] | ||
|Get session id. | |Get session id. | ||
|- | |- | ||
− | |[[JSession::getName | + | |public |
+ | |[[API17:JSession::getName|getName]] | ||
|Get session name. | |Get session name. | ||
|- | |- | ||
− | |[[JSession::getState | + | |public |
+ | |[[API17:JSession::getState|getState]] | ||
|Get current state of session. | |Get current state of session. | ||
|- | |- | ||
− | |[[JSession::getToken | + | |public |
+ | |[[API17:JSession::getToken|getToken]] | ||
|Get a session token, if a token isn't set yet one will be generated. | |Get a session token, if a token isn't set yet one will be generated. | ||
|- | |- | ||
− | |[[JSession::has | + | |public |
+ | |[[API17:JSession::has|has]] | ||
|Check whether data exists in the session store. | |Check whether data exists in the session store. | ||
|- | |- | ||
− | |[[JSession::hasToken | + | |public |
+ | |[[API17:JSession::hasToken|hasToken]] | ||
|Method to determine if a token exists in the session. | |Method to determine if a token exists in the session. | ||
|- | |- | ||
− | |[[JSession::isNew | + | |public |
+ | |[[API17:JSession::isNew|isNew]] | ||
|Check whether this session is currently created. | |Check whether this session is currently created. | ||
|- | |- | ||
− | |[[JSession::restart | + | |public |
+ | |[[API17:JSession::restart|restart]] | ||
|Restart an expired or locked session. | |Restart an expired or locked session. | ||
|- | |- | ||
− | |[[JSession::set | + | |public |
+ | |[[API17:JSession::set|set]] | ||
|Set data into the session store. | |Set data into the session store. | ||
|- | |- | ||
− | |[[JSession::getFormToken | + | |public static |
+ | |[[API17:JSession::getFormToken|getFormToken]] | ||
|Method to determine a hash for anti-spoofing variable names. | |Method to determine a hash for anti-spoofing variable names. | ||
|- | |- | ||
− | |[[JSession::getInstance | + | |public static |
+ | |[[API17:JSession::getInstance|getInstance]] | ||
|Returns the global Session object, only creating it if it doesn't already exist. | |Returns the global Session object, only creating it if it doesn't already exist. | ||
|- | |- | ||
− | |[[JSession::getStores | + | |public static |
+ | |[[API17:JSession::getStores|getStores]] | ||
|Get the session handlers. | |Get the session handlers. | ||
|- | |- | ||
− | |[[JSession::_createId | + | |protected |
+ | |[[API17:JSession::_createId|_createId]] | ||
|Create a session id. | |Create a session id. | ||
|- | |- | ||
− | |[[JSession::_createToken | + | |protected |
+ | |[[API17:JSession::_createToken|_createToken]] | ||
|Create a token-string. | |Create a token-string. | ||
|- | |- | ||
− | |[[JSession::_setCookieParams | + | |protected |
+ | |[[API17:JSession::_setCookieParams|_setCookieParams]] | ||
|Set session cookie parameters. | |Set session cookie parameters. | ||
|- | |- | ||
− | |[[JSession::_setCounter | + | |protected |
+ | |[[API17:JSession::_setCounter|_setCounter]] | ||
|Set counter of session usage. | |Set counter of session usage. | ||
|- | |- | ||
− | |[[JSession::_setOptions | + | |protected |
− | | | + | |[[API17:JSession::_setOptions|_setOptions]] |
+ | |Set additional session options. | ||
|- | |- | ||
− | |[[JSession::_setTimers | + | |protected |
+ | |[[API17:JSession::_setTimers|_setTimers]] | ||
|Set the session timers. | |Set the session timers. | ||
|- | |- | ||
− | |[[JSession::_start | + | |protected |
+ | |[[API17:JSession::_start|_start]] | ||
|Start a session. | |Start a session. | ||
|- | |- | ||
− | |[[JSession::_validate | + | |protected |
+ | |[[API17:JSession::_validate|_validate]] | ||
|Do some checks for security reason. | |Do some checks for security reason. | ||
|- | |- | ||
|} | |} | ||
+ | * '''Defined in''' libraries/joomla/session/session.php | ||
+ | * '''Extends''' [[API17:JObject|JObject]] | ||
===Importing=== | ===Importing=== | ||
<source lang="php">jimport( 'joomla.session.session' );</source> | <source lang="php">jimport( 'joomla.session.session' );</source> | ||
===See also=== | ===See also=== | ||
− | * [[JSession|Other versions of | + | * {{JVer|11.1}} '''JSession source code''' on [[jplatform:session/session.php|BitBucket]] |
+ | * {{JVer|11.1}} Subpackage [[API17:Subpackage Session|Session]] | ||
+ | * [[API17:JSession|Other versions of JSession]] | ||
{{SeeAlso:JSession}} | {{SeeAlso:JSession}} | ||
<span class="editsection" style="font-size:76%;"> | <span class="editsection" style="font-size:76%;"> | ||
<nowiki>[</nowiki>[[SeeAlso:JSession|Edit See Also]]<nowiki>]</nowiki> | <nowiki>[</nowiki>[[SeeAlso:JSession|Edit See Also]]<nowiki>]</nowiki> | ||
</span> | </span> | ||
− | === | + | ===User contributed notes=== |
<CodeExamplesForm /> | <CodeExamplesForm /> | ||
<dpl> | <dpl> | ||
Line 118: | Line 146: | ||
category=ClassExample | category=ClassExample | ||
include=* | include=* | ||
+ | namespace=CodeExample | ||
format= ,,, | format= ,,, | ||
</dpl> | </dpl> | ||
− | <noinclude> | + | <noinclude>[[Category:Platform 11.1]][[Category:Archived pages API17]]</noinclude> |
Revision as of 21:27, 11 May 2013
The "API17" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.
JSession[edit]
Description[edit]
Template:Description:JSession [Edit Descripton]
Methods[edit]
Visibility | Method name | Description |
---|---|---|
public | __construct | Constructor. |
public | __destruct | Session object destructor. |
public | clear | Unset data from the session store. |
public | close | Writes session data and ends session. |
public | destroy | Frees all session variables and destroys all data registered to a session. |
public | fork | Create a new session and copy variables from the old one. |
public | get | Get data from the session store. |
public | getExpire | Get expiration time in minutes. |
public | getId | Get session id. |
public | getName | Get session name. |
public | getState | Get current state of session. |
public | getToken | Get a session token, if a token isn't set yet one will be generated. |
public | has | Check whether data exists in the session store. |
public | hasToken | Method to determine if a token exists in the session. |
public | isNew | Check whether this session is currently created. |
public | restart | Restart an expired or locked session. |
public | set | Set data into the session store. |
public static | getFormToken | Method to determine a hash for anti-spoofing variable names. |
public static | getInstance | Returns the global Session object, only creating it if it doesn't already exist. |
public static | getStores | Get the session handlers. |
protected | _createId | Create a session id. |
protected | _createToken | Create a token-string. |
protected | _setCookieParams | Set session cookie parameters. |
protected | _setCounter | Set counter of session usage. |
protected | _setOptions | Set additional session options. |
protected | _setTimers | Set the session timers. |
protected | _start | Start a session. |
protected | _validate | Do some checks for security reason. |
- Defined in libraries/joomla/session/session.php
- Extends JObject
Importing[edit]
jimport( 'joomla.session.session' );
See also[edit]
- JSession source code on BitBucket
- Subpackage Session
- Other versions of JSession
Template:SeeAlso:JSession [Edit See Also]
User contributed notes[edit]
<CodeExamplesForm />