JFactory/getSession: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 44: | Line 44: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=getSession | category=getSession | ||
category=JFactory | category=JFactory | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 01:39, 25 March 2017
Description
Get a session object
<! removed transcluded page call, red link never existed >
Syntax
static getSession($options=array())
| Parameter Name | Default Value | Description |
|---|---|---|
| $options | array() | An array containing session options |
Returns
object
Defined in
libraries/joomla/factory.php
Importing
jimport( 'joomla.factory' );
Source Body
public static function getSession($options = array())
{
if (!is_object(JFactory::$session)) {
JFactory::$session = JFactory::_createSession($options);
}
return JFactory::$session;
}
<! removed transcluded page call, red link never existed >
Examples
Code Examples