Add an example that demonstrates using cookies

This commit is contained in:
Sasha Koshka 2025-03-27 18:29:34 -04:00
parent 4c19694c4c
commit 7e0c0b079b
2 changed files with 13 additions and 0 deletions

View File

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<head>
</head>
<body>
{{$counter := getCookie .Data.Req "counter" | atoi | add 1}}
{{toString $counter | setCookie .Data.Res "counter"}}
<p>You have refreshed this page {{$counter}} time{{if gt $counter 1}}s{{end}}.</p>
</body>
</html>

View File

@ -0,0 +1,3 @@
# allows other devices on your local network to use cookies even if you aren't
# using https, etc.
http.insecure-cookie: true