How to use "remember me" cookie with auth in CakePHP 3? I have use the following code in my controller:
if ($this->request->data['data']['rememberMe'] == "on") {
$cookie = array();
$cookie['username'] = $this->request->data['username'];
$cookie['password'] = $this->request->data['password'];
$this->request->Cookie->write('rememberMe', $cookie, true, "1 week");
unset($this->request->data['rememberMe']);
}
and get the error :
Call to a member function write() on a non-object