Keeps request context for the visit, so recordings can carry it.
LiveView sees only some request details when it connects. This plug
sees every request of the visit, copies what the :client config asks for into
the session, and PhoenixReplay.Recorder adds it to each recording's
client on the connected mount. Add it to the pipeline your live
sessions use, after :fetch_session:
pipeline :browser do
plug :accepts, ["html"]
plug :fetch_session
# ...
plug PhoenixReplay.Plug
endWith no headers or landing configured in :client, it does nothing.
What it keeps
- headers — the
:headersallowlist, from the latest request, each value cut to 256 characters - landing — the visit's landing request, when
:landingis configured: its URL path and time, the tracked query params, and theReferer. Withattribution: :firstit is written once per visit; with:lasta request carrying tracked params replaces it.
A visit lasts as long as the session cookie. The session is rewritten
only when the kept context changes. Only GET requests are landings.
The kept context stays under 1 KB, so a crafted link cannot overflow a cookie session: past that, the landing's params are dropped, then the headers.
Summary
Functions
The session key the context is kept under.
Functions
@spec session_key() :: String.t()
The session key the context is kept under.