Add an example that demonstrates using cookies
This commit is contained in:
parent
4c19694c4c
commit
7e0c0b079b
10
examples/cookie/index.step
Normal file
10
examples/cookie/index.step
Normal 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>
|
3
examples/cookie/step.meta
Normal file
3
examples/cookie/step.meta
Normal 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
|
Loading…
Reference in New Issue
Block a user