invalidate cookie on server side in compojure
(defn invalidate-cookie []
{:value "invalidate."
:path "/"
:max-age 0
:expires "Thu, 01 Jan 1970 00:00:00 GMT"})
Then assoc the new cookie to request:
(defn signout [req]
{:status 200 :cookies (assoc (:cookies req) "cookie_key" (invalidate-cookie) :body "..."})
Written by dennis zhuang
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Clojure
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#