本文整理汇总了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();
}