package session
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Module Session.MemorySource
In-memory backend using the S.Now signature.
The default expiry period is one week.
include S.Now
with type key = string
and type value = string
and type period = int64
The type of a handle on the backend.
The type of a session key.
The type of a session value.
The type of a session expiry period.
default_period t returns default period after which session keys will expire. Depending on the backend, this value may vary over time.
generate ?expiry ?value t will allocate a new session in the backend t and return its associated key. The session will expire expiry seconds from now, defaulting to default_period t if one is not explicitly specified.
The key should be unique, though it may not be in order to allow implementations that use randomness or hashing to conform to this interface.
clear t key removes key from the backend t. The backend may choose to persist the session value beyond this call, but any subsequent calls operations involving key should behave as if key is not present in the backend.
get t key returns the session value, if present and unexpired, together with its expiry period as of now.