Table of Contents

setSession

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JApplication Method setSession Reference setSession() Never Work in Progress

Creates the user session. Old sessions are flushed based on the configuration value for the cookie lifetime. If there is an existing session, then the last access time is updated. If it is a new session, then the session id is generated and a record is created in the #__sessions table. This method is called by the Joomla! core and should not need to be invoked by extensions.

Syntax

void setSession ( $name )

$name string is a string containing the name of the session.

Examples

This method is called in the following way by the Joomla! core (index.php):

Example

$mainframe->setSession( $mainframe->getCfg('live_site').$mainframe->getClientId() );

Note that unique sessions are created for the various clients.