Actions

API15

JSession/ construct

From Joomla! Documentation

< API15:JSession
Revision as of 17:17, 22 March 2010 by Doxiki (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Constructor

[Edit Descripton]

Description:JSession/ construct

Syntax

__construct($store= 'none', $options=array())
Parameter Name Default Value Description
$store 'none' $storage
$options array() $options optional parameters

Defined in

libraries/joomla/session/session.php

Importing

jimport( 'joomla.session.session' );

Source Body

function __construct( $store = 'none', $options = array() )
{
        // Register faked "destructor" in PHP4, this needs to happen before creating the session store
        if (version_compare(PHP_VERSION, '5') == -1) {
                register_shutdown_function((array(&$this, '__destruct')));
        }
 
        //Need to destroy any existing sessions started with session.auto_start
        if (session_id()) {
                session_unset();
                session_destroy();
        }
 
        //set default sessios save handler
        ini_set('session.save_handler', 'files');
 
        //disable transparent sid support
        ini_set('session.use_trans_sid', '0');
 
        //create handler
        $this->_store =& JSessionStorage::getInstance($store, $options);
 
        //set options
        $this->_setOptions( $options );
 
        $this->_setCookieParams();
 
        //load the session
        $this->_start();
 
        //initialise the session
        $this->_setCounter();
        $this->_setTimers();
 
        $this->_state = 'active';
 
        // perform security checks
        $this->_validate();
}

[Edit See Also] SeeAlso:JSession/ construct

Examples

<CodeExamplesForm />