aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Okay <okay@toyful.space>2022-02-16 14:19:28 -0600
committerColin Okay <okay@toyful.space>2022-02-16 14:19:28 -0600
commitf9ca15af8b2f36d80c2edccd81e1a54d7ffe58a6 (patch)
tree2c78ecadc8cf89e2e70ee603f5e204031e30bd11
parentdc33589b34af73c14ff25e42488f31e0b09ba405 (diff)
replaced setf response-cookie with set-response-cookie
-rw-r--r--lazybones-hunchentoot.lisp18
-rw-r--r--package.lisp1
2 files changed, 14 insertions, 5 deletions
diff --git a/lazybones-hunchentoot.lisp b/lazybones-hunchentoot.lisp
index be3e009..f404eb6 100644
--- a/lazybones-hunchentoot.lisp
+++ b/lazybones-hunchentoot.lisp
@@ -228,11 +228,19 @@ the value of the Content-Type request header."
"Access the cookie with NAME in the response object."
(h:cookie-out name response))
-(defun (setf response-cookie) (value name &optional (response lzb:*response*))
- (a:if-let (extant-cookie (assoc name (h:cookies-out response) :test #'string=))
- (setf (cdr extant-cookie) value)
- (cadar (setf (h:cookies-out response)
- (cons (cons name value) (h:cookies-out response))))))
+(defun set-response-cookie
+ (name value
+ &key expires max-age path domain secure http-only (response lzb:*response*))
+ "Sets the response cookie"
+ (h:set-cookie name
+ :value value
+ :expires expires
+ :max-age max-age
+ :path path
+ :domain domain
+ :secure secure
+ :http-only http-only
+ :reply response))
(defun http-respond (content &optional (code 200))
"Final step preparing response before backend does the rest. For
diff --git a/package.lisp b/package.lisp
index 35ef7ab..934dcc3 100644
--- a/package.lisp
+++ b/package.lisp
@@ -20,6 +20,7 @@
;; resposne functions
#:response-header
#:response-code
+ #:set-response-cookie
#:response-cookie
#:http-respond
;; server functions