本文整理匯總了PHP中CakeSession::valid方法的典型用法代碼示例。如果您正苦於以下問題:PHP CakeSession::valid方法的具體用法?PHP CakeSession::valid怎麽用?PHP CakeSession::valid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CakeSession
的用法示例。
在下文中一共展示了CakeSession::valid方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: valid
/**
* Used to check for a valid session.
*
* In your controller: $this->Session->valid();
*
* @return boolean true is session is valid, false is session is invalid
* @access public
*/
function valid()
{
if ($this->__active === true) {
$this->__start();
return parent::valid();
}
return false;
}
示例2: valid
/**
* Returns true if session is valid.
*
* @return bool Success
*/
public static function valid()
{
if (self::start() && self::read('Config')) {
if (self::_validAgentAndTime() && self::$error === false) {
self::$valid = true;
} else {
self::$valid = false;
self::_setError(1, 'Session Highjacking Attempted !!!');
}
}
return self::$valid;
}
示例3: valid
/**
* Used to check is a session is valid in a view
*
* @return bool
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/session.html#SessionHelper::valid
*/
public function valid()
{
return CakeSession::valid();
}
示例4: valid
/**
* Used to check is a session is valid in a view
*
* @return boolean
* @access public
*/
function valid()
{
if ($this->__active === true && $this->__start()) {
return parent::valid();
}
}
示例5: _checkValid
/**
* Helper method to create a new session.
*
* @return void
*/
protected static function _checkValid()
{
if (!self::started() && !self::start()) {
self::$valid = false;
return false;
}
if ($config = self::read('Config')) {
$sessionConfig = Configure::read('Session');
if (self::_validAgentAndTime()) {
self::write('Config.time', self::$sessionTime);
if (isset($sessionConfig['autoRegenerate']) && $sessionConfig['autoRegenerate'] === true) {
$check = $config['countdown'];
$check -= 1;
self::write('Config.countdown', $check);
if ($check < 1) {
self::renew();
self::write('Config.countdown', self::$requestCountdown);
}
}
self::$valid = true;
} else {
self::destroy();
self::$valid = false;
self::_setError(1, 'Session Highjacking Attempted !!!');
}
} else {
self::write('Config.userAgent', self::$_userAgent);
self::write('Config.time', self::$sessionTime);
self::write('Config.countdown', self::$requestCountdown);
self::$valid = true;
}
}
示例6: valid
/**
* Used to check is a session is valid in a view
*
* @return boolean
* @access public
*/
function valid()
{
if ($this->__active === true) {
return parent::valid();
}
}