{"record":{"id":"863d3da62802a4c2","repo":"hasura/graphql-engine","slug":"jwt-authorization-token-source-cookie-name-cooki","errorCode":null,"errorMessage":"JWT Authorization token source: cookie name {cookie_name} not found in the Cookie header","messagePattern":"JWT Authorization token source: cookie name (.+?) not found in the Cookie header","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"v3/crates/auth/hasura-authn-jwt/src/jwt.rs","lineNumber":52,"sourceCode":"    ExpectedStringifiedJson,\n    #[error(\"The default role is not present in the allowed roles\")]\n    DisallowedDefaultRole,\n    #[error(\"The specified role is not present in the allowed roles\")]\n    DisallowedRole,\n    #[error(\"Error while parsing the claims map entry: {claim_name} - {err}\")]\n    ParseClaimsMapEntryError {\n        claim_name: String,\n        err: serde_json::Error,\n    },\n    #[error(\"Expected string value for claim {claim_name}\")]\n    ClaimMustBeAString { claim_name: String },\n    #[error(\"Required claim {claim_name} not found\")]\n    RequiredClaimNotFound { claim_name: String },\n    #[error(\"JWT Authorization token source: Header name {header_name} not found.\")]\n    AuthorizationHeaderSourceNotFound { header_name: String },\n    #[error(\"JWT Authorization token source: Cookie header not found\")]\n    CookieNotFound,\n    #[error(\n        \"JWT Authorization token source: cookie name {cookie_name} not found in the Cookie header\"\n    )]\n    CookieNameNotFound { cookie_name: String },\n    #[error(\"Error in parsing the {header_name} header: {err}\")]\n    AuthorizationHeaderParseError { err: String, header_name: String },\n    #[error(\"Error in parsing the Cookie header value: {err}\")]\n    CookieParseError { err: cookie::ParseError },\n    #[error(\"Missing corresponding value for the cookie with cookie name: {cookie_name}\")]\n    MissingCookieValue { cookie_name: String },\n    #[error(\"JWT validation error: {0}\")]\n    JWTValidationError(jwt::errors::Error),\n    #[error(\"Internal Error - {0}\")]\n    Internal(#[from] InternalError),\n}\n\nimpl TraceableError for Error {\n    fn visibility(&self) -> ErrorVisibility {\n        // For the purpose of traces, all JWT errors should be developer facing.","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/hasura/graphql-engine/blob/724551b9ae87845594ef0408cff0e50eb6c90dc5/v3/crates/auth/hasura-authn-jwt/src/jwt.rs#L34-L70","documentation":"A Cookie header was present, but the specific cookie configured as the JWT source (`{cookie_name}`) is not among the parsed cookies.","triggerScenarios":"Cookie auth mode with cookie name (e.g. `__Host-authorization-token`), request has other cookies but not the configured one — cookie expired, renamed, or never set.","commonSituations":"Cookie name mismatch between auth-server config and JWT config; cookie expired or was cleared; cookie set on a different domain/path so the client never echoes it back.","solutions":["Compare the configured {cookie_name} with the cookie name actually set by your auth server","Log the incoming Cookie header to see what the client sent","Check cookie expiry, Domain and Path attributes on the set-cookie response","Align the cookie name across auth server and JWT configuration"],"exampleFix":"// before: JWT config cookie name: \"session\"; auth server sets \"__Host-session\"\n// after: use the identical name in both configs","handlingStrategy":"validation","validationCode":"const cookies = parseCookies(req.headers.get('cookie') ?? '');\nif (!(config.cookieName in cookies)) return unauthorized(`cookie ${config.cookieName} missing`);","typeGuard":"const hasCookie = (c: Record<string,string>, n: string): boolean => n in c && c[n] !== '';","tryCatchPattern":"Return 401 naming the expected cookie; direct the user to re-authenticate to set it.","preventionTips":["Keep cookie name identical across auth server and engine config","Verify cookie Domain/Path/Expiry attributes"],"tags":["jwt","cookies","auth"],"backgroundTag":"missing-auth-cookie","analyzedSha":"724551b9ae87845594ef0408cff0e50eb6c90dc5","analyzedAt":"2026-08-28T07:32:55.105Z","schemaVersion":2},"datasetVersion":"2026-08-28T11:17:15.048Z"}