Last active
June 23, 2016 21:29
-
-
Save wedesoft/59f436566a960aefbe570deb30f1d017 to your computer and use it in GitHub Desktop.
Guile Artanis user session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-modules (artanis artanis) (artanis cookie) (artanis utils)) | |
(init-server) | |
(get "/" #:session 'spawn | |
(lambda (rc) | |
(let [(sid (or (cookie-ref (rc-cookie rc) "sid") (:session rc 'spawn))) | |
(time (strftime "%c" (localtime (current-time))))] | |
(tpl->response `(html (body (p ,sid) (p ,time))))))) | |
(run) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment