Session wrapper does not update the cookie after session expiry date is changed. #79

Closed
zby opened this Issue Feb 2, 2013 · 1 comment

2 participants

@zby
zby commented Feb 2, 2013
(ns ring-session-test.core)

(use 'ring.middleware.session)

(defn handler [{session :session uri :uri}]
  (let [res {:status 200
             :headers {"Content-Type" "text/plain"}
             :body (str session)
             :session {:a 1}}]
    (if (= (session :a) 1)
      (assoc res :session-cookie-attrs {:max-age 3600})
      res)))

(def app
  (wrap-session handler))

What I wanted is that the session cookie is sent on the first request
and then set the expiry date on another one. But on the second
request there is no cookie sent - I copy the headers below. If I add
:session-cookie-attrs on the first response - then it gets there in
the Cookie:

Set-Cookie:ring-session=00bd9357-a388-4714-ac1b-4e66def7e2f7;Max-Age=3600;Path=/

But on the second not.


Request URL:http://localhost:3000/che
Request Method:GET
Status Code:200 OK

Request Headersview source

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Cookie:ring-session=519317a4-6543-42b5-ab6d-49cf0bba8bba
Host:localhost:3000
User-Agent:Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML,
like Gecko) Chrome/24.0.1312.56 Safari/537.17

Response Headersview source

Content-Length:6
Content-Type:text/plain;charset=ISO-8859-1
Date:Wed, 30 Jan 2013 13:47:30 GMT
Server:Jetty(7.6.1.v20120215)

@weavejester
Collaborator

Closed due to deprecated repository.

@weavejester weavejester closed this Feb 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment