| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
rfc.cookie - HTTP cookie handling HTTP_COOKIE.
If the cookie version is known, via "Cookie2" request header,
the integer version must be passed to version. Otherwise,
parse-cookie figures out the version from string.
The result has the following format.
((<name> <value> [:path <path>] [:domain <domain>] [:port <port>]) ...) |
#f. (Note that it differs from the attribute
having null value, "".)
If the attribute has path, domain or port options, it is given
as a form of keyword-value pair.
Set-cookie2 or Set-cookie header.
Optional version argument specifies cookie protocol version. 0 for the old Netscape style format, and 1 for RFC2965 style format. When omitted, version 1 is assumed.
Each cookie spec has the following format.
(<name> <value> [:comment <comment>] [:comment-url <url>]
[:discard <bool>] [:domain <domain>]
[:max-age <age>] [:path <path>]
[:port <port-list>] [:secure <bool>]
[:version <version>] [:expires <date>])
|
<name>
<value>
#f if no value is needed.
<comment> <url> <domain> <path> <port-list>
<bool>
<age> <version>
<date>
The attribute values are quoted appropriately. If the specified attribute is irrelevant for the version, it is ignored. So you can pass the same specs to generate both old-style and new-style cookie strings.
Return value is a list of cookie strings, each of which stands for
each cookie. For old-style protocol (using Set-cookie header)
you must send each of them by individual header. For new-style
protocol (using Set-cookie2 header), you can join them
with comma and send it at once. See RFC2965 for further details.
Some examples:
(construct-cookie-string
'(("name" "foo" :domain "foo.com :path "/"
:expires (+ (sys-time) 86400) :max-age 86400)))
=> ("name=foo;Domain=foo.com;Path=/;Max-age=86400")
(construct-cookie-string
'(("name" "foo" :domain "foo.com :path "/"
:expires (+ (sys-time) 86400) :max-age 86400))
0)
=>
("name=foo;Domain=foo.com;Path=/;Expires=Sun, 09-Sep-2001 01:46:40 GMT")
|
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |