Changeset 10860 in project

05/17/08 21:49:52 (12 years ago)

Describe new cookie procedures in web-unity

1 edited


  • wiki/web-unity

    r10857 r10860  
    6868Get the current value of the given header.  If the optional default is given, this is returned if the header is not found, otherwise {{#f}} is returned.
     70==== wu:cookie-set!
     72  (wu:cookie-set! name value #!key comment max-age domain path secure)
     74Set the current value of the RFC2109 cookie with the given name.
     76Cookies will expire when the session ends (usually when the browser closes) unless {{MAX-AGE}} is supplied, which is an integer argument declaring the maximum time the cookie can be stored on the client side, in seconds. A {{MAX-AGE}} of 0 also results in the cookie being deleted when the session ends.
     78{{COMMENT}} is an optional comment specifying the nature of the cookie. The user will see this in his browser's cookie store, and may use this to decide wether or not to accept the cookie.
     80The {{DOMAIN}} string specifies for which domain the cookie is. The cookie will only be returned on subsequent requests to that domain. By default, the domain is the domain from which the cookie originates.
     82The {{PATH}} string specifies the topmost path from which this cookie is active. If there are multiple cookies with the same name, the value from the cookie with the most specific ("deepest") path will be passed to the server.
     84Finally, the boolean {{SECURE}} can be set to {{#t}} if the cookie should be treated as confidential information.
     86==== wu:cookie-delete!
     88  (wu:cookie-delete! name #!key domain path)
     90Delete the given cookie. Equivalent to calling {{wu:cookie-set!}} with a {{MAX-AGE}} of zero.
    7092==== Request parameters
    7496; {{wu:request-method}} (symbol) : The current request's HTTP method as a lower-cased symbol (get, post).
    7597; {{wu:params}} (alist) : The current HTTP method's parameters with their values (all strings).  With GET this is equal to the {{query-params}}, with POST it contains the POST request attributes
     98; {{wu:cookies}} (alist) : The current RFC2109 cookies, as name-value pairs (all strings).
    7699; {{wu:query-params}} (alist) : The current query parameters (URL commandline parameters), even if the method is {{post}}, for example.
    77100; {{wu:script-name}} (string): The absolute path to the script in the URL, up to, but not including, the pathinfo.
Note: See TracChangeset for help on using the changeset viewer.