Macaw.State.Persistence.Session (macaw v0.6.0)

Copy Markdown View Source

State in the session (spec/03 §3): the carrier is a session map, as a host reads it (get_session/1, or a LiveView's mount/3 session), each surface's values under its name, as text. It is for state that must not go in a URL: visitor-specific state stays with the visitor, never in a link someone could share.

store/3 answers the session map with the surface's values written; the host puts it back (put_session/3 of the surface's key, in a controller or a plug), since a LiveView's session is read-only.