Build a session payload to seed into a signed session cookie. Pair with
Test.PagesProgram.CookieJar.setSession
to place the signed value into the cookie jar for a test.
import Test.BackendTask as BackendTaskTest
import Test.PagesProgram.CookieJar as CookieJar
import Test.PagesProgram.Session as Session
BackendTaskTest.init
|> CookieJar.withCookies
(CookieJar.init
|> CookieJar.setSession
{ name = "mysession"
, secret = "test-secret"
, session =
Session.init
|> Session.withValue "userId" "42"
|> Session.withFlash "greeting" "Welcome back!"
}
)Add a persistent session value.
Add a flash session value. Flash values are available on the next request
only, matching Server.Session.withFlash.
A session payload: a set of persistent session values and one-shot flash values. Mirrors the shape produced by
Server.Sessionat runtime.