JSession/restart: Difference between revisions
From Joomla! Documentation
New page: ===Description===
Restart an expired or locked session.
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</... |
m clean up |
||
| Line 2: | Line 2: | ||
Restart an expired or locked session. | Restart an expired or locked session. | ||
{{Description:JSession/restart}} | |||
{{subst:Description:JSession/restart}} | |||
===Syntax=== | ===Syntax=== | ||
| Line 47: | Line 45: | ||
</source> | </source> | ||
{{subst:SeeAlso:JSession/restart}} | |||
{{SeeAlso:JSession/restart}} | |||
===Examples=== | ===Examples=== | ||
Revision as of 14:23, 24 March 2017
Description
Restart an expired or locked session.
{{subst:Description:JSession/restart}}
Syntax
restart()
Returns
boolean true on success
Defined in
libraries/joomla/session/session.php
Importing
jimport( 'joomla.session.session' );
Source Body
public function restart()
{
$this->destroy();
if ($this->_state !== 'destroyed') {
// @TODO :: generated error here
return false;
}
// Re-register the session handler after a session has been destroyed, to avoid PHP bug
$this->_store->register();
$this->_state = 'restart';
//regenerate session id
$id = $this->_createId(strlen($this->getId()));
session_id($id);
$this->_start();
$this->_state = 'active';
$this->_validate();
$this->_setCounter();
return true;
}
{{subst:SeeAlso:JSession/restart}}
Examples
<CodeExamplesForm />