本文整理汇总了PHP中eZSession::regenerate方法的典型用法代码示例。如果您正苦于以下问题:PHP eZSession::regenerate方法的具体用法?PHP eZSession::regenerate怎么用?PHP eZSession::regenerate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZSession
的用法示例。
在下文中一共展示了eZSession::regenerate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: logoutCurrent
static function logoutCurrent()
{
$http = eZHTTPTool::instance();
$id = false;
$GLOBALS["eZUserGlobalInstance_{$id}"] = false;
$contentObjectID = $http->sessionVariable('eZUserLoggedInID');
// reset session data
$newUserID = self::anonymousId();
eZSession::setUserID($newUserID);
$http->setSessionVariable('eZUserLoggedInID', $newUserID);
// Clear current basket if necessary
$db = eZDB::instance();
$db->begin();
eZBasket::cleanupCurrentBasket();
$db->commit();
if ($contentObjectID) {
//set last visit to minus
self::updateLastVisitByLogout($contentObjectID);
//clean up sessions
self::cleanup();
}
// give user new session id
eZSession::regenerate();
// set the property used to prevent SSO from running again
self::$userHasLoggedOut = true;
}
示例2: logoutCurrent
static function logoutCurrent()
{
$http = eZHTTPTool::instance();
$id = false;
$GLOBALS["eZUserGlobalInstance_$id"] = false;
$contentObjectID = $http->sessionVariable( 'eZUserLoggedInID' );
// reset session data
$newUserID = self::anonymousId();
eZSession::setUserID( $newUserID );
$http->setSessionVariable( 'eZUserLoggedInID', $newUserID );
// Clear current basket if necessary
$db = eZDB::instance();
$db->begin();
if ( eZINI::instance( 'site.ini' )->variable( 'Session', 'UseBasket' ) != 'false' )
{
eZBasket::cleanupCurrentBasket();
}
$db->commit();
if ( $contentObjectID )
self::cleanup();
// give user new session id
eZSession::regenerate();
// set the property used to prevent SSO from running again
self::$userHasLoggedOut = true;
}