Created
January 20, 2013 10:27
-
-
Save zby/4577752 to your computer and use it in GitHub Desktop.
The referer changes correctly, but the session is first {} and then always: {:x nil}
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
(ns login-app.ex) | |
(use 'ring.middleware.session | |
'ring.util.response) | |
(defn handl [{session :session uri :uri headers :headers}] | |
(let [body | |
(str | |
"<html><body>" | |
session "<br>\n" | |
" referer: " (get headers "referer") "<br>\n" | |
"<a href='" uri "x'>" uri "x</a>" | |
"</body></html>")] | |
{:status 200 | |
:headers {"Content-Type" "text/html"} | |
:body body | |
:session {:x (get headers "referer")}})) | |
(def app | |
(wrap-session handl)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment