protected function setRememberCookie($userId) { $this->setId($userId); $this->setTable('user'); $this->readRecordsById('id', 'password_hash'); $hash = $this->getRecordsById()[0]['password_hash']; Cookie::set('remember', $this->user['id'] . '-' . md5($this->user['id'] . $_SERVER['REMOTE_ADDR'] . crypt($this->password, $hash)), time() + 3600 * 24 * 7, '/admin'); }
static function set() { Cookie::set('basket', serialize(self::$basket)); }