Class CookieJar

Namespace
Kuestenlogik.Bowire.Auth
Assembly
Kuestenlogik.Bowire.dll

Per-environment in-memory cookie store. Bowire holds one CookieContainer per environment id while the workbench process runs; the REST plugin hands the container to a fresh per-call HttpClientHandler when the JS layer marked the request with MarkerKey, so cookies set by one call (e.g. POST /login) ride along on every following call to the same origin (GET /me).

Memory-only by design: process restart wipes the jar, which mirrors what an actual logged-out browser session looks like. Persistent storage would buy little since secrets in cookies are already short- lived and the user can re-authenticate trivially.

public static class CookieJar
Inheritance
CookieJar
Inherited Members

Fields

MarkerKey

Magic metadata key the JS auth layer uses to opt a request into the persistent cookie jar. The value is the active environment id — Bowire keeps one container per env so dev/staging/prod don't share session cookies. Stripped from the request headers before the actual HTTP call so the marker never reaches the wire.

public const string MarkerKey = "__bowireCookieEnv__"

Field Value

string

Methods

Clear(string)

Drop every cookie associated with envId. Wired into the env-auth UI's "Clear cookies" button via the /api/auth/cookie-jar endpoint.

public static bool Clear(string envId)

Parameters

envId string

Returns

bool

GetOrCreate(string)

Look up the container for the supplied environment id, creating one on the fly the first time it's referenced.

public static CookieContainer GetOrCreate(string envId)

Parameters

envId string

Returns

CookieContainer

Snapshot(string)

Snapshot of every (origin, name=value) pair currently stored for envId. Used by the workbench to render the cookies the next request will replay; the underlying container is the source of truth, this is read-only.

public static IReadOnlyList<CookieSnapshot> Snapshot(string envId)

Parameters

envId string

Returns

IReadOnlyList<CookieSnapshot>