session-expirely middleware removes a session after specified time
from last access, but I don't know this is helpful for your purpose.
https://github.com/hozumi/session-expiry
2011/12/21 Timothy Washington <twas...@gmail.com>:
> And I assume this can be used in Sandbar's notion of
> stateful sessions (since it just uses Ring under the hood).
You can combine any number of middleware.
(def app
(-> #'handler
(wrap-session-expiry 3600)
sandbar.stateful-session/wrap-stateful-session
ring.middleware.cookies/wrap-cookies))
> One thing I'm trying to wrap my head around, is when Ring ( thus Compojure
> or Sandbar ) creates a session.
I didn't understand it until you asked.
If request have no ring-session in cookie and response-map have
:session(not nil), then Set-Cookie: ring-session=... seems to be
emitted.
It also depends on an implementation of write-session of SessionStore
protocol, because Set-Cookie is emitted everytime when write-session
returns a new key.
MemoryStore(default) returns a new key only when request have no
ring-session key in cookie.
ref
https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/session/store.clj
https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/session/memory.clj#L11
https://github.com/mmcgrana/ring/blob/master/ring-core/src/ring/middleware/cookies.clj#L118
Thanks.
2011/12/22 Timothy Washington <twas...@gmail.com>: