Core\Session
Keeps values for one visitor from one request to the next. A short-lived value is kept until the browser closes or the visitor is inactive for [session] short_lived. A long-lived value is kept for [session] long_lived. The first call of any method opens the session. By default, the values are saved in a SQLite file in the data folder. [session] backend = "shared" saves them in the shared cache instead.
Members
12 members.
| Member | Signature |
|---|---|
setShortLived | setShortLived(string $key, mixed $value): void |
setLongLived | setLongLived(string $key, mixed $value): void |
get | get(string $key): mixed |
remove | remove(string $key): void |
clearShortLived | clearShortLived(): void |
clearLongLived | clearLongLived(): void |
clearAll | clearAll(): void |
regenerate | regenerate(): void |
setShortLivedSecret | setShortLivedSecret(string $key, secret string $value, array<secret bytes> $keys): void |
setLongLivedSecret | setLongLivedSecret(string $key, secret string $value, array<secret bytes> $keys): void |
getSecret | getSecret(string $key, array<secret bytes> $keys): ?secret string |
openWithIdentifier | openWithIdentifier(string $id): void |
Example apps
These complete apps use this class. You can download and run each one.
- Chat: A chat app with rooms, WebSockets and SQLite. One Novis server sends the pages and runs every connection, with no separate WebSocket server and no library.
