fukamachi / caveman

Lightweight web application framework for Common Lisp.
http://8arrow.org/caveman/
775 stars 63 forks source link

Set cookies. #91

Closed rlisper closed 7 years ago

rlisper commented 7 years ago

Sorry, maybe an obvious question, but what is properly way to set cookies in caveman2? I try to set (request-cookies request) in the defroute macro but it doesn't work for me.

knobo commented 7 years ago

I don't know what is the proper way, but I do the following:

(defun make-cookie (name &key value path domain secure httponly expires)
  (setf (getf (caveman2:response-set-cookies *response*) name)
    (list :value value
          :domain domain
          :expires expires
          :secure secure
          :path path
          :httponly httponly)))

request-cookies is for reading cookies not setting