Documentation for Module: cookie.r ||  Module Index

Context Index
Cookie Functions: ==>
Overview expire get set value

Context: Cookie

In General: OverviewTopContext IndexNext Function
    syntax: !Overview
    author: Tim Johnson tim@akwebsoft.com
    SEE http://webmaster.info.aol.com/aboutcookies.html
      Sets and gets cookies as per RFC 2109. Set before content-type header.
      NOTE: Cookie values are parsed for a (key|val) format.
      Public Interface Functions:
        get cookie-name:
          If found, return cookie value
            If the cookie value fits the (key|val) format
              return a block of key/value pairs (keys as strings)
                the block is stored as variable data
        value key:
          return a value matching key.
            Assumes that data block was filled from results of parsing (key|val)
              formatted value string for the last evaluation of cookie/get.
        set args:
          args is is a block of alternating symbols (keys) and values.
            keys as follows: (as per RFC) ** = REQUIRED
              name - string **
              value - string OR block **
                If block, alternating keys and values.
                  key may be word or string of any spelling
                    NOTE: keys are NOT currently being evaluated
                      value may be anything
                    composed as (key|val) component of values string.
              expires - string or block (block is recommended!)
                if block, alternating keys and numeric values.
                  keys as follows: Year, months, days, hours, minutes
                    corresponding values are positive and set date by key.
                if not set, cookies expires when browser is closed
              Path - string
              Domain - string. Must have at least two periods (see example below)
              Secure - any value. value is discarded, as secure is boolean.
                do not use UNLESS you want cookie used only by secure connections.
    example:
        To set:
          cookie/set
            [expires [months 34 days 24 hours 1 minutes 30] name "client-info"
             value ["email" tim@johnsons-web.com password "mypwd"]
             path "/cgi-bin/" secure "yes" domain ".aol.com" ]
        To retrieve:
          cookie/get "client-info"
            ==> ["email" "tim@johnsons-web.com" "password" "mypwd"]
          When you inspect this cookie you should see an expiration date that is
            34 months, 24 days, 1 hour and 30 minutes from the time that the
              cookies was set.
Function: Cookie/expireTopContext IndexPrevious FunctionNext Function
    syntax: cookie/expire Expire the cookie. Provide name and path
Function: Cookie/getTopContext IndexPrevious FunctionNext Function
    syntax: cookie/get <str-name> Get a cookie.
    description: Parse if (key|val) format. Resulting keys and values will be strings.
Function: Cookie/setTopContext IndexPrevious FunctionNext Function
    syntax: cookie/set <args-block> Set the cookie with attributes
    Note: args block must be of an even length
Function: Cookie/valueTopContext IndexPrevious Function
    syntax: cookie/value <str-key> Get a value from self/data. none is returned if not found