getCookie(self::COOKIE_NAME); if ($passphrase === null) { $passphrase = $random->generate(128); $secureCookie = $request->getServerProtocol() === 'https'; // FIXME: Required for CI if (!defined('PHPUNIT_RUN')) { $webRoot = \OC::$WEBROOT; if ($webRoot === '') { $webRoot = '/'; } setcookie( self::COOKIE_NAME, $passphrase, [ 'expires' => 0, 'path' => $webRoot, 'domain' => '', 'secure' => $secureCookie, 'httponly' => true, 'samesite' => 'Lax', ] ); } } $this->passphrase = $passphrase; } public function wrapSession(ISession $session): ISession { if (!($session instanceof CryptoSessionData)) { return new CryptoSessionData($session, $this->crypto, $this->passphrase); } return $session; } }