testing/cross_backend/session_cookie_effect.ts

What a response does to the session cookie, read off its Set-Cookie lines — shared by the conformance runner (expect.set_cookie and its always-on no-mint-on-refusal floor) and the cross-backend differential, which compares the classification across backends since it compares header names, not values.

Both readings spell the expected lines through the spine's own formatters (format_session_clear_cookie, format_session_set_cookie), so the harness and the spine cannot drift apart silently: a clear or a mint whose bytes differ from what the formatters write — an attribute moved, dropped or added — classifies as no effect at all (null).

view source

Declarations
#

4 declarations

classify_session_cookie_effect
#

filter_session_set_cookies
#

testing/cross_backend/session_cookie_effect.ts view source

(set_cookies: readonly string[], cookie_name: string): string[] import {filter_session_set_cookies} from '@fuzdev/fuz_app/testing/cross_backend/session_cookie_effect.js';

The Set-Cookie lines that name the session cookie, in response order.

set_cookies

every Set-Cookie line of the response, in order

type readonly string[]

cookie_name

the session cookie's name

type string

returns

string[]

find_session_cookie_mints
#

SessionCookieEffect
#

testing/cross_backend/session_cookie_effect.ts view source

SessionCookieEffect

type "none" | "clear" | "set" | "clear_then_set"

import type {SessionCookieEffect} from '@fuzdev/fuz_app/testing/cross_backend/session_cookie_effect.js';

What a response does to the session cookie, by its Set-Cookie lines for the cookie's name, in order:

  • none — no line for the session cookie
  • clear — exactly one line, the clearing string
  • set — exactly one line minting a cookie: a non-empty value, the fixed attributes, a positive Max-Age
  • clear_then_set — the clear followed by a mint, what a login answers when the request carried a session cookie that does not verify: the session middleware prepares the clear before the handler appends the new cookie

Depends on
#

Imported by
#