本文整理匯總了PHP中eZSession::hasSessionCookie方法的典型用法代碼示例。如果您正苦於以下問題:PHP eZSession::hasSessionCookie方法的具體用法?PHP eZSession::hasSessionCookie怎麽用?PHP eZSession::hasSessionCookie使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZSession
的用法示例。
在下文中一共展示了eZSession::hasSessionCookie方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: registerFunctions
/**
* Register the needed session functions, this is called automatically by
* {@link eZSession::start()}, so only call this if you don't start the session.
*
* @since 4.1
* @return bool Depending on if eZSession is registrated as session handler.
*/
protected static function registerFunctions()
{
if (self::$hasStarted || self::$handlerInstance !== null) {
return false;
}
$ini = eZINI::instance();
if ($ini->variable('Session', 'SessionNameHandler') === 'custom') {
$sessionName = $ini->variable('Session', 'SessionNamePrefix');
if ($ini->variable('Session', 'SessionNamePerSiteAccess') === 'enabled') {
$access = $GLOBALS['eZCurrentAccess'];
// Use md5 to make sure name is only consistent of alphanumeric characters
$sessionName .= md5($access['name']);
}
session_name($sessionName);
} else {
$sessionName = session_name();
}
// See if user has session, used to avoid reading from db if no session.
// Allow session bye post params for use by flash, but use $_POST directly
// to avoid session double start issues ( #014686 ) caused by eZHTTPTool
if (isset($_POST[$sessionName])) {
// First use session id from post params (for use in flash upload)
session_id($_POST[$sessionName]);
self::$hasSessionCookie = true;
} else {
// else check cookie as used by default
self::$hasSessionCookie = isset($_COOKIE[$sessionName]);
}
return self::getHandlerInstance()->setSaveHandler();
}