API17

Difference between revisions of "JSession"

From Joomla! Documentation

(Layout updates)
(Updated to r1448:247ba8d88526)
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>
{{Description:JSession}}
 
===Defined in===
 
libraries/joomla/session/session.php
 
* see source code in [[jplatform:session/session.php|BitBucket]]
 
===Subpackage===
 
[[Subpackage Session/11.1|Session]]
 
===Extends===
 
[[JObject/11.1|JObject]]
 
===Extended by===
 
 
===Methods===
 
===Methods===
 
{| class="wikitable sortable"
 
{| class="wikitable sortable"
 
|-
 
|-
 +
!Visibility
 
!Method name
 
!Method name
 
!Description
 
!Description
 
|-
 
|-
 +
|public
 
|[[JSession::__construct/11.1|__construct]]
 
|[[JSession::__construct/11.1|__construct]]
 
|Constructor.  
 
|Constructor.  
 
|-
 
|-
 +
|public
 
|[[JSession::__destruct/11.1|__destruct]]
 
|[[JSession::__destruct/11.1|__destruct]]
 
|Session object destructor.  
 
|Session object destructor.  
 
|-
 
|-
 +
|public
 
|[[JSession::clear/11.1|clear]]
 
|[[JSession::clear/11.1|clear]]
 
|Unset data from the session store.  
 
|Unset data from the session store.  
 
|-
 
|-
 +
|public
 
|[[JSession::close/11.1|close]]
 
|[[JSession::close/11.1|close]]
 
|Writes session data and ends session.  
 
|Writes session data and ends session.  
 
|-
 
|-
 +
|public
 
|[[JSession::destroy/11.1|destroy]]
 
|[[JSession::destroy/11.1|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.  
 
|-
 
|-
 +
|public
 
|[[JSession::fork/11.1|fork]]
 
|[[JSession::fork/11.1|fork]]
 
|Create a new session and copy variables from the old one.  
 
|Create a new session and copy variables from the old one.  
 
|-
 
|-
 +
|public
 
|[[JSession::get/11.1|get]]
 
|[[JSession::get/11.1|get]]
 
|Get data from the session store.  
 
|Get data from the session store.  
 
|-
 
|-
 +
|public
 
|[[JSession::getExpire/11.1|getExpire]]
 
|[[JSession::getExpire/11.1|getExpire]]
 
|Get expiration time in minutes.  
 
|Get expiration time in minutes.  
 
|-
 
|-
 +
|public
 
|[[JSession::getId/11.1|getId]]
 
|[[JSession::getId/11.1|getId]]
 
|Get session id.  
 
|Get session id.  
 
|-
 
|-
 +
|public
 
|[[JSession::getName/11.1|getName]]
 
|[[JSession::getName/11.1|getName]]
 
|Get session name.  
 
|Get session name.  
 
|-
 
|-
 +
|public
 
|[[JSession::getState/11.1|getState]]
 
|[[JSession::getState/11.1|getState]]
 
|Get current state of session.  
 
|Get current state of session.  
 
|-
 
|-
 +
|public
 
|[[JSession::getToken/11.1|getToken]]
 
|[[JSession::getToken/11.1|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.  
 
|-
 
|-
 +
|public
 
|[[JSession::has/11.1|has]]
 
|[[JSession::has/11.1|has]]
 
|Check whether data exists in the session store.  
 
|Check whether data exists in the session store.  
 
|-
 
|-
 +
|public
 
|[[JSession::hasToken/11.1|hasToken]]
 
|[[JSession::hasToken/11.1|hasToken]]
 
|Method to determine if a token exists in the session.  
 
|Method to determine if a token exists in the session.  
 
|-
 
|-
 +
|public
 
|[[JSession::isNew/11.1|isNew]]
 
|[[JSession::isNew/11.1|isNew]]
 
|Check whether this session is currently created.  
 
|Check whether this session is currently created.  
 
|-
 
|-
 +
|public
 
|[[JSession::restart/11.1|restart]]
 
|[[JSession::restart/11.1|restart]]
 
|Restart an expired or locked session.  
 
|Restart an expired or locked session.  
 
|-
 
|-
 +
|public
 
|[[JSession::set/11.1|set]]
 
|[[JSession::set/11.1|set]]
 
|Set data into the session store.  
 
|Set data into the session store.  
 
|-
 
|-
 +
|public static
 
|[[JSession::getFormToken/11.1|getFormToken]]
 
|[[JSession::getFormToken/11.1|getFormToken]]
 
|Method to determine a hash for anti-spoofing variable names.  
 
|Method to determine a hash for anti-spoofing variable names.  
 
|-
 
|-
 +
|public static
 
|[[JSession::getInstance/11.1|getInstance]]
 
|[[JSession::getInstance/11.1|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.  
 
|-
 
|-
 +
|public static
 
|[[JSession::getStores/11.1|getStores]]
 
|[[JSession::getStores/11.1|getStores]]
 
|Get the session handlers.  
 
|Get the session handlers.  
 
|-
 
|-
 +
|protected
 
|[[JSession::_createId/11.1|_createId]]
 
|[[JSession::_createId/11.1|_createId]]
 
|Create a session id.  
 
|Create a session id.  
 
|-
 
|-
 +
|protected
 
|[[JSession::_createToken/11.1|_createToken]]
 
|[[JSession::_createToken/11.1|_createToken]]
 
|Create a token-string.  
 
|Create a token-string.  
 
|-
 
|-
 +
|protected
 
|[[JSession::_setCookieParams/11.1|_setCookieParams]]
 
|[[JSession::_setCookieParams/11.1|_setCookieParams]]
 
|Set session cookie parameters.  
 
|Set session cookie parameters.  
 
|-
 
|-
 +
|protected
 
|[[JSession::_setCounter/11.1|_setCounter]]
 
|[[JSession::_setCounter/11.1|_setCounter]]
 
|Set counter of session usage.  
 
|Set counter of session usage.  
 
|-
 
|-
 +
|protected
 
|[[JSession::_setOptions/11.1|_setOptions]]
 
|[[JSession::_setOptions/11.1|_setOptions]]
|set additional session options  
+
|Set additional session options.
 
|-
 
|-
 +
|protected
 
|[[JSession::_setTimers/11.1|_setTimers]]
 
|[[JSession::_setTimers/11.1|_setTimers]]
 
|Set the session timers.  
 
|Set the session timers.  
 
|-
 
|-
 +
|protected
 
|[[JSession::_start/11.1|_start]]
 
|[[JSession::_start/11.1|_start]]
 
|Start a session.  
 
|Start a session.  
 
|-
 
|-
 +
|protected
 
|[[JSession::_validate/11.1|_validate]]
 
|[[JSession::_validate/11.1|_validate]]
 
|Do some checks for security reason.  
 
|Do some checks for security reason.  
 
|-
 
|-
 
|}
 
|}
 +
* '''Defined in''' libraries/joomla/session/session.php
 +
* '''Extends''' [[JObject/11.1|JObject]]
 
===Importing===
 
===Importing===
 
<source lang="php">jimport( 'joomla.session.session' );</source>
 
<source lang="php">jimport( 'joomla.session.session' );</source>
 
===See also===
 
===See also===
* JSession source code in [[jplatform:session/session.php|BitBucket]]
+
* {{JVer|11.1}} '''JSession source code''' on [[jplatform:session/session.php|BitBucket]]
* [[JSession|Other versions of this class]]
+
* {{JVer|11.1}} Subpackage [[Subpackage Session/11.1|Session]]
 +
* [[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>
===Examples===
+
===User contributed notes===
 
<CodeExamplesForm />
 
<CodeExamplesForm />
 
<dpl>
 
<dpl>
Line 120: Line 146:
 
category=ClassExample
 
category=ClassExample
 
include=*
 
include=*
 +
namespace=CodeExample
 
format= ,,,
 
format= ,,,
 
</dpl>
 
</dpl>
 
<noinclude>[[Category:Platform]][[Category:Platform 11.1]][[Category:JSession]]</noinclude>
 
<noinclude>[[Category:Platform]][[Category:Platform 11.1]][[Category:JSession]]</noinclude>

Revision as of 18:08, 27 April 2011

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.

Joomla 11.1 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]

Template:SeeAlso:JSession [Edit See Also]

User contributed notes[edit]

<CodeExamplesForm />