本文整理匯總了PHP中Cookie::setSafeCode方法的典型用法代碼示例。如果您正苦於以下問題:PHP Cookie::setSafeCode方法的具體用法?PHP Cookie::setSafeCode怎麽用?PHP Cookie::setSafeCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Cookie
的用法示例。
在下文中一共展示了Cookie::setSafeCode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: logout
public function logout()
{
$this->safebox->clear('user');
$cookie = new Cookie();
$cookie->setSafeCode(Tiny::app()->getSafeCode());
$cookie->set('autologin', null, 0);
$this->redirect('login');
}
示例2: autoLoginUserInfo
static function autoLoginUserInfo()
{
$cookie = new Cookie();
$cookie->setSafeCode(Tiny::app()->getSafeCode());
$autologin = $cookie->get('autologin');
$obj = null;
if ($autologin != null) {
$email = Filter::sql($autologin['email']);
$password = $autologin['password'];
$model = new Model("user as us");
//$obj = $model->join("left join customer as cu on us.id = cu.user_id")->fields("us.*,cu.group_id,cu.login_time")->where("us.mobile='$mobile'")->find();
$obj = $model->join("left join customer as cu on us.id = cu.user_id")->fields("us.*,cu.group_id,cu.login_time")->where("us.email='{$email}'")->find();
if ($obj['password'] != $password) {
$obj = null;
}
}
return $obj;
}