{"record":{"id":"f1f949f53ce74c01","repo":"nextcloud/server","slug":"strict-cookie-check-failed","errorCode":null,"errorMessage":"Strict cookie check failed","messagePattern":"Strict cookie check failed","errorType":"exception","errorClass":"Sabre\\DAV\\Exception\\PreconditionFailed","httpStatus":412,"severity":"error","filePath":"apps/dav/lib/Connector/Sabre/PublicAuth.php","lineNumber":67,"sourceCode":"\t\tprivate IURLGenerator $urlGenerator,\n\t) {\n\t\t// setup realm\n\t\t$defaults = new Defaults();\n\t\t$this->realm = $defaults->getName();\n\t}\n\n\t/**\n\t * @throws NotAuthenticated\n\t * @throws MaxDelayReached\n\t * @throws ServiceUnavailable\n\t */\n\t#[\\Override]\n\tpublic function check(RequestInterface $request, ResponseInterface $response): array {\n\t\ttry {\n\t\t\t$this->throttler->sleepDelayOrThrowOnMax($this->request->getRemoteAddress(), self::BRUTEFORCE_ACTION);\n\n\t\t\tif (count($_COOKIE) > 0 && !$this->request->passesStrictCookieCheck() && $this->getShare()->isPasswordProtected()) {\n\t\t\t\tthrow new PreconditionFailed('Strict cookie check failed');\n\t\t\t}\n\n\t\t\t$auth = new HTTP\\Auth\\Basic(\n\t\t\t\t$this->realm,\n\t\t\t\t$request,\n\t\t\t\t$response\n\t\t\t);\n\n\t\t\t$userpass = $auth->getCredentials();\n\t\t\t// If authentication provided, checking its validity\n\t\t\tif ($userpass && !$this->validateUserPass($userpass[0], $userpass[1])) {\n\t\t\t\treturn [false, 'Username or password was incorrect'];\n\t\t\t}\n\n\t\t\treturn $this->checkToken();\n\t\t} catch (NotAuthenticated|MaxDelayReached $e) {\n\t\t\t$this->throttler->registerAttempt(self::BRUTEFORCE_ACTION, $this->request->getRemoteAddress());\n\t\t\tthrow $e;","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/nextcloud/server/blob/ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3/apps/dav/lib/Connector/Sabre/PublicAuth.php#L49-L85","documentation":"Error \"Strict cookie check failed\" thrown in nextcloud/server.","triggerScenarios":"Thrown at apps/dav/lib/Connector/Sabre/PublicAuth.php:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ecdeb153ffdf227235c9a7e2d13dbe0f9c817bc3","analyzedAt":"2026-08-17T01:36:13.386Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}