Files
wren/test/web/session.wren
T
retoor 5a4054ec66 feat: add example scripts for argparse, bytes, dataset, html, markdown, uuid, wdantic, and web chat modules
Add comprehensive demo scripts showcasing the usage of multiple Wren modules including argument parsing, byte manipulation, in-memory dataset operations, HTML encoding/slugification, markdown-to-HTML conversion, UUID generation/validation, schema validation with wdantic, and a full web chat application with REST endpoints.
2026-01-24 22:40:22 +00:00

20 lines
534 B
JavaScript
Vendored

// retoor <retoor@molodetz.nl>
import "web" for SessionStore
var store = SessionStore.new()
var session = store.create()
System.print(session.id != null) // expect: true
System.print(session.id.count) // expect: 36
session["user"] = "alice"
System.print(session["user"]) // expect: alice
store.save(session)
var retrieved = store.get(session.id)
System.print(retrieved != null) // expect: true
System.print(retrieved["user"]) // expect: alice
store.destroy(session.id)
System.print(store.get(session.id) == null) // expect: true