Files
wren/test/web/session_advanced.wren
T
retoor 74ef5cbc11 feat: add merge_all_wren utility, strutil demo, and 7 new API manual pages
Add WrenFileReader class in apps/merge_all_wren.wren for recursive .wren file discovery and content printing. Introduce example/strutil_demo.wren demonstrating case conversion, hex encoding, SHA256 hashing, string repetition, padding, HTML/JSON escaping, and URL encoding/decoding. Create manual/api pages for argparse, dataset, html, markdown, uuid, wdantic, and web modules. Update manual/api/index.html sidebar and module count from 21 to 28, adding links and cards for the new modules.
2026-01-25 01:47:47 +00:00

35 lines
996 B
JavaScript
Vendored

// retoor <retoor@molodetz.nl>
import "web" for Session, SessionStore
var store = SessionStore.new()
var session = store.create()
session["name"] = "Alice"
session["age"] = 30
session["active"] = true
System.print(session["name"]) // expect: Alice
System.print(session["age"]) // expect: 30
System.print(session["active"]) // expect: true
System.print(session["nonexistent"] == null) // expect: true
System.print(session.isModified) // expect: true
session.remove("age")
System.print(session["age"] == null) // expect: true
store.save(session)
var data = session.data
System.print(data.containsKey("name")) // expect: true
System.print(data.containsKey("age")) // expect: false
System.print(data["active"]) // expect: true
var session2 = store.create()
var session3 = store.create()
System.print(session.id != session2.id) // expect: true
System.print(session2.id != session3.id) // expect: true
System.print(session.id.count) // expect: 36
System.print(session2.id.count) // expect: 36