class

HTTPSession::Storage(T)

Inherits HTTPSession::StorageInterface < Reference < Object

A base class for implementing storage backends.

Instance methods

[](session_id : String) : T | Nil

Fetches the storage value for session_id. Returns nil if no value exists.

Source
[]=(session_id : String, session : T) : Nil

Sets the storage value for session_id.

Source
delete_expired(min : Time) : Nil

Deletes all expired storage values, i.e. which have not been touched since time.

Source
fetch(session_id : String) : Entry(T) | Nil

Fetches an entry indicated by session_id. Returns nil if no entry exists.

Source
gc_interval

The interval for deleting expired session values.

Source
gc_interval=(gc_interval : Time::Span)

The interval for deleting expired session values.

Source
max_age

The maximum age.

Source
max_age=(max_age : Time::Span)

The maximum age.

Source
put(session_id : String, entry : Entry(T)) : Nil

Sets the entry for session_id.

Source
run_gc_loop

Runs a loop that call delete_expired every interval of gc_interval.

Source

Nested types