HTTP cookies can be set by CSA in the client browser with the
csaCookie.set function. Unsetting a cookie is not supported, and is left up to the client browser. In general, session cookies are dropped by browsers after a while, or when the browser is closed, while persistent cookies have an explicit expiration date.
Say you want to set a cookie with the assignment
mycookie=somevalue in the client browser. This can be done by calling
csaCookie.set as follows:
The single-quotes around the
= sign are mandated by
rc, and also
somevalue will have to follow the
rc quoting rules, where appropriate. To virtually "unset" a cookie, we can simply set it again with a bogus value. Actually unsetting the cookie in the client browser is more tricky, as it would require the inclusion of all the information that was used to set it, and specifying an expiration date in the past. When a cookie is set multiple times in the client, the latter will return all values beginning with the most recent one. CSA always considers the first cookie value returned, so setting a cookie to a bogus value is virtually equivalent to unsetting it, from the CSA point of view.
Trackbacks (1) |
New trackback |