State Management
Server-side state management with application-wide and per-session counters, plus reactive session variables.
Application Counter
This counter is shared across all browsers and all sessions — every visitor, in any browser, sees and increments the exact same value (unlike the per-browser session counter below). Use w-set to mutate application state declaratively from HTML.
Application data persists across all sessions and is stored server-side. Atomic read-modify-write prevents race conditions under concurrent access.
Wired Counter (Real-time)
This counter updates in real time across all connected browsers via WebSocket. Open this page in two tabs or two browsers and watch them stay in sync.
<span>4</span>
Wired state is like application state, but pushes updates to every connected client instantly.
No WebSocket code needed — just use wired.* in your w-set attribute.
Session Counter
This counter is private to this browser. Open the page in a different browser (or a private/incognito window) and you'll get a separate count — it's tied to your session cookie, not shared. Contrast with the application counter above, which is the same for everyone.
Session data is tied to your browser session and resets when the session expires.
Session Variables
Template variables like provide direct access to session state. These are automatically wrapped with reactive bindings for live updates.
Session variables update reactively when their values change on the server.
Clear Session Data
Reset all session-specific data, including counters and any stored session variables.