Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expiring of sessions in clack.middleware.session #47

Open
h11r opened this issue Jun 26, 2012 · 2 comments
Open

Expiring of sessions in clack.middleware.session #47

h11r opened this issue Jun 26, 2012 · 2 comments
Labels

Comments

@h11r
Copy link
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
Copy link

wnortje commented Sep 23, 2015

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

@gibsonf1
Copy link

gibsonf1 commented Jul 3, 2017

I would also be very happy to have an answer for this. For now, I hacked in my expire time to finalize-state in lack/src/middleware/session/state/cookie.lisp .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants