Security & Identity · zero-dependency · MIT

larzsession

Signed cookie sessions + CSRF.

Stateless signed-cookie sessions with HMAC integrity plus CSRF protection — secure session handling for any WSGI app without a session store.

larzscript pkg install session
View on GitHub →Learn the stack

What you get

Try it

import "session" as session
let cookie = session.create({"user_id": 42}, "app-secret")
let data = session.verify(cookie, "app-secret")
print(data["user_id"])
let tampered = cookie[0:len(cookie)-1] + "X"
print(session.verify(tampered, "app-secret"))
Output
42
nil

Why it's in the Larz Stack

larzsession is a real Larzscript package (larzscript pkg install session) - money-native, zero dependencies, the same language as the rest of the estate, not a separate Python runtime. It composes with the rest of the Larz Stack and the Larz framework.