Expiring of sessions in clack.middleware.session #47

Open
h11r opened this Issue Jun 26, 2012 · 1 comment

Projects

None yet

2 participants

@h11r
Contributor
h11r commented Jun 26, 2012

When trying to expire a session by setting the :expire keyword in the hash map :clack.session.options the <clack-session-state-cookie> middleware raises a type miss-match. This is because <clack-middleware-session> calls clack.session.state:expire with the options hash-table converted to a plist while <clack-session-state-cookie> expects the original hash-table:

;;; from core/middleware/session.lisp
(defmethod expire ((this <clack-middleware-session>) id res env)
  (state:expire
   (state this)
   id res
   (hash-table-plist (getf env :clack.session.options))))

;;; from core/middleware/state/cookie.lisp
(defmethod expire ((this <clack-session-state-cookie>)
                              id res &optional options)
  (setf (gethash :expires options) 0) ;; here is the problem
  (finalize this id res options))
@wnortje
wnortje commented Sep 23, 2015

I have the same problem. Is there a workaround for expiring a session?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment