| 1 | --- |
| 2 | // Zero-config sessions under `output: "server"`: no session driver is |
| 3 | // configured anywhere in this fixture — the integration defaults to the |
| 4 | // Cloudflare KV driver (binding "SESSION"), auto-injects a local KV |
| 5 | // namespace in dev, and the live preview provides a miniflare KV namespace. |
| 6 | const count = ((await Astro.session?.get("count")) ?? 0) + 1; |
| 7 | Astro.session?.set("count", count); |
| 8 | --- |
| 9 | |
| 10 | <html lang="en"> |
| 11 | <head> |
| 12 | <meta charset="utf-8" /> |
| 13 | <title>Session</title> |
| 14 | </head> |
| 15 | <body> |
| 16 | <h1>Session</h1> |
| 17 | <p id="count">{count}</p> |
| 18 | </body> |
| 19 | </html> |