Namespace

Runtime\PS\Session

Package session implements Session\Manager and the Session\Storage\* family: an HTTP-only cookie carrying an opaque, randomly generated session ID, and the...

Description

Package session implements Session\Manager and the Session\Storage\* family: an HTTP-only cookie carrying an opaque, randomly generated session ID, and the storage the data behind that ID lives in. Memory storage lasts as long as the process; disk storage is a file per session under a directory the host chooses, and prunes by modification time.

A manager wraps whichever storage it receives for tracing and a request's trace shows which backend it paid for and whether the session exists. The trace omits the session ID: that ID is the credential in the cookie.

Who a session belongs to is stdlib/ps/auth's subject. A manager holds the user database a host gave it and puts one question to that, in login(); everything else here is the cookie and the storage.

Importing the package wires it in; stdlib/imports.go does that.

Package
stdlib/ps/sessiongodoc