Storing

$cookie:name[value]
Saves cookie with specified name and specified value to be stored for 90 days.

Example
$cookie:user[Peter]

…will create cookie named
user and assign value Peter to it. The cookie thus created will be stored on user's disk for 90 days.

Note: cookies' values are accessible for reading immediately after they have been assigned.

$cookie:name[
   $.value[value]
   $.expires(number of days)
]
$cookie:name[
   $.value[value]
   $.expires[session]
]
$cookie:name[
   $.value[value]
   $.domain[domain name]
]
$cookie:name[
   $.value[value]
   $.path[subsection]
]
$cookie:name[
   $.value[
value]
   $.httponly(true)    
[3.2.2]
   $.secure(true)      
[3.2.2]
]

…assigns data to cookie with specified
name.

Optional modifiers:
$.expires(number of days)-specifies how many days a cookie may be accessible (number of days may be fractional, i.e. 1.5 will mean "one day and half").
$.expires[session]-creates session cookie (cookie will be deleted when visitor closes all browser windows);
$.domain[doman name]-specifies domain from which the cookie may be accessed;
$.path[subsection]-specifies subsection of the site from which the cookie may be accessed.

During storing cookie you can add any bool option. In this case the http header will contains this option without value. You can use it for set httponly option for example.

Example
$cookie:login_name[
   $.value[guest]
   $.expires(14)
]


…will create a cookie named
login_name with value guest and store it a fortnight.



Copyright © 1997–2010 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 20.09.2007