【发布时间】:2016-09-10 16:50:36
【问题描述】:
我想销毁令牌,但那不起作用:
$this->Auth->注销();
你能帮帮我吗?谢谢大家
【问题讨论】:
标签: php cakephp-3.0
我想销毁令牌,但那不起作用:
$this->Auth->注销();
你能帮帮我吗?谢谢大家
【问题讨论】:
标签: php cakephp-3.0
public function login()
{
if ($this->request->is('post')) {
$user = $this->Auth->identify();
if ($user) {
$this->Auth->setUser($user);
return $this->redirect($this->Auth->redirectUrl());
}
$this->Flash->error(__('Invalid username or password, try again'));
}
}
public function logout()
{
return $this->redirect($this->Auth->logout());
}
【讨论】:
Jwt 未存储在服务器上。要注销,您只需删除客户端上的令牌。 如果您想在过期之前使其失效,则必须手动将令牌插入数据库并在每次请求时检查令牌是否失效
【讨论】: