Storing

$cookie:name[value]

$cookie:name[
   $.value[value]
   ...optional modifiers...
]

Saves cookie with specified name and specified value. In case of no optional modifiers were specified the cookie will be stored for 90 days.
Note: cookies' values are accessible for reading immediately after they have been assigned.

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 a half").
$.expires[session]-creates session cookie (cookie will be deleted when visitor closes all browser windows);
$.expires[$date]-creates a cookie which may be accessible till specified date and time;
$.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.
$.httponly(true)-any key with bool value can be specified. In this case the http header will contains this option without its value. You can use this for set httponly or secure options for example.   [3.2.2]

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.


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–2021 Art. Lebedev Studio | http://www.artlebedev.com Last updated: 15.05.2011