SessionStorageInterface
interface SessionStorageInterface (View source)
| internal |
Defines persistence and identifier lifecycle operations used by the session facade.
Storage implementations are construction details of {\Lemonade\Framework\Session\SessionFactory}; consumers resolve {\Lemonade\Framework\Session\Contract\SessionInterface} instead.
Methods
Initializes the backend before it serves session values
Reports whether the backend has been initialized for this request
Checks whether the backend contains a value for the key
Reads a value from the backend or returns the supplied fallback
Persists a value under the key in the active session
Removes the value stored under the key from the active session
Removes all values from the active session
Removes the active record, invalidates its identifier, and expires its browser cookie.
Replaces the active identifier and optionally removes its prior record
Details
start
void
start()
Initializes the backend before it serves session values
started
bool
started()
Reports whether the backend has been initialized for this request
has
bool
has(string $key)
Checks whether the backend contains a value for the key
get
mixed
get(string $key, mixed $default = null)
Reads a value from the backend or returns the supplied fallback
set
void
set(string $key, mixed $value)
Persists a value under the key in the active session
remove
void
remove(string $key)
Removes the value stored under the key from the active session
clear
void
clear()
Removes all values from the active session
destroy
void
destroy()
Removes the active record, invalidates its identifier, and expires its browser cookie.
A later access starts a new session identity.
regenerate
void
regenerate(bool $deleteOldSession = true)
Replaces the active identifier and optionally removes its prior record