Skip to content

Instantly share code, notes, and snippets.

@zby
Created January 20, 2013 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zby/4577752 to your computer and use it in GitHub Desktop.
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}
(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