本文整理汇总了PHP中JApplicationWeb::afterSessionStart方法的典型用法代码示例。如果您正苦于以下问题:PHP JApplicationWeb::afterSessionStart方法的具体用法?PHP JApplicationWeb::afterSessionStart怎么用?PHP JApplicationWeb::afterSessionStart使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JApplicationWeb
的用法示例。
在下文中一共展示了JApplicationWeb::afterSessionStart方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: afterSessionStart
/**
* Event listener for the `onAfterSessionStart` event.
*
* @param JSession $session Session object
*
* @return void
*
* @since 3.2
*/
public function afterSessionStart(JSession $session)
{
parent::afterSessionStart($session);
// If not using the database store, register the cleanup function to run at the end of the application cycle
if ($session->storeName != 'database') {
$this->registerEvent('onAfterRender', array($this, 'cleanupSessionMetadata'));
}
/*
* Check for extra session metadata when:
*
* 1) The database handler is in use and the session is new
* 2) The database handler is not in use and the time is an even numbered second or the session is new
*/
if ($session->storeName != 'database' && (time() % 2 || $session->isNew()) || $session->storeName == 'database' && $session->isNew()) {
$this->checkSession($session);
}
}