Skip to content

Dealing with Cookies

daninus14 edited this page Feb 15, 2024 · 2 revisions

There are multiple ways to set cookies with caveman2.

Using the :headers Property

See ningle:*response*

Using response-set-cookies

response-set-cookies is part of the response struct.

(setf (lack.response:response-set-cookies ningle:*response*)
               cookies)

Where cookies must be a property list that has a key as the name and a value as a property list containing :value, :domain, :path, :expires, :secure, :httponly, and :samesite.

ex. ("foobar" (:value "barbaz"))

Here is the code of Lack.Response: https://github.com/fukamachi/lack/blob/master/src/response.lisp#L44