This is cookie.egg.info, produced by makeinfo version 4.7 from eggdoc-output.texi. INFO-DIR-SECTION The Algorithmic Language Scheme START-INFO-DIR-ENTRY * cookie.egg: (cookie.egg). A library for parsing and constructing HTTP cookies END-INFO-DIR-ENTRY  File: cookie.egg.info, Node: Top, Next: About this egg, Up: (dir) cookie egg ********** A library for parsing and constructing HTTP cookies Written by Shiro Kawai, ported to Chicken by Reed Sheridan This manual corresponds to version 1.1 of the cookie extension library for Chicken Scheme. * Menu: * About this egg:: * Documentation:: * Examples:: * License:: * Index::  File: cookie.egg.info, Node: About this egg, Next: Documentation, Prev: Top, Up: Top 1 About this egg **************** * Menu: * Version history:: * Usage::  File: cookie.egg.info, Node: Version history, Next: Usage, Up: About this egg 1.1 Version history =================== `1.1' Fix bugs related to quoting output of construct-cookie-string `1.0' Initial release  File: cookie.egg.info, Node: Usage, Prev: Version history, Up: About this egg 1.2 Usage ========= Load this egg like so: `(require-extension cookie)'  File: cookie.egg.info, Node: Documentation, Next: Examples, Prev: About this egg, Up: Top 2 Documentation *************** -- procedure: parse-cookie-string (parse-cookie-string string #!optional version) Parse a cookie string `string', which is the value of the "Cookie" request header. Usually, this information is available to a CGI program via the environment variable HTTP_COOKIE. If the cookie version is known, via the "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. `(( [path: ] [domain: ] [port: ]) ...)' where `' is the attribute name, and `' is the corresponding value. If the attribute doesn't have value, `' is #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. -- procedure: construct-cookie-string (construct-cookie-string specs #!optional version) Given list of cookie specs, creates a cookie string suitable for `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. `( [comment: ] [comment-url: ] '`[discard: ] [domain: ] '`[max-age: ] [path: ] '`[port: ] [secure: ] '`[version: ] [expires: ]) ' Where, `' A string. Name of the cookie. `' Value of the cookie. May be a string, or #f if no value is needed. ` ' Strings. `' Boolean value ` ' Integers `' Either an integer (seconds since Epoch) or a formatted date string following the netscape cookie specification. 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.  File: cookie.egg.info, Node: Examples, Next: License, Prev: Documentation, Up: Top 3 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")  File: cookie.egg.info, Node: License, Next: Index, Prev: Examples, Up: Top 4 License ********* Copyright (c) 2000-2003 Shiro Kawai, All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the authors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  File: cookie.egg.info, Node: Index, Prev: License, Up: Top Index ***** [index] * Menu: * construct-cookie-string: Documentation. (line 29) * parse-cookie-string: Documentation. (line 7)  Tag Table: Node: Top255 Node: About this egg640 Node: Version history807 Node: Usage1034 Node: Documentation1196 Node: Examples3973 Node: License4473 Node: Index6116  End Tag Table