Skip to main content

Module session

Module session 

Source
Expand description

Persistent-profile Chrome session, and the classification of what a failed /kr-api/ call actually means.

Everything here rests on one measured fact: a real Chrome whose User-Agent does not say HeadlessChrome clears Cloudflare on k-ruoka.fi unaided, and a same-origin fetch() from inside the loaded page carries the session cookies without any manual cookie handling.

Structs§

Session

Enums§

ApiError
Why a /kr-api/ call did not produce a usable answer.
LaunchMode

Constants§

SHOP_ORIGIN
SHOP_URL

Traits§

KrApi
The seam between cart logic and the browser.

Functions§

default_profile_dir
Where the login is stored, per platform convention. K_RUOKA_PROFILE overrides, which is how the tests and the spike get a scratch profile instead of the real login.
default_store_path
Where the persisted default store id is written, alongside the Chrome profile directory.