public function startSession(int $userId, $su = false) { $expiry = $this->config->get('private/site/session_length', '+1 day'); $jwtValue = $this->jwt->encode((object) ['user_id' => $userId], $expiry); $this->response->setCookie($su ? self::ADMIN_COOKIE_NAME : self::COOKIE_NAME, $jwtValue, $expiry); }