CGI Services Architecture
Recent Pages

Environment Variables
Handling Concurrency
Template Processing
RDF Responses
RDF Messaging
URL Rewriting
File Uploads
Sample Authenticated Se ...
HTTP Cookies
Client Authentication

Links on Twitter
CSA Home
Table of Contents



User ID

Campaigns petition banner

HTTP Cookies

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:

 csaCookie.set mycookie'='somevalue 
The single-quotes around the = sign are mandated by rc, and also mycookie and 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 | Print

This Web Site is Copyright © 2007,2008,2009,2010 Carlo Strozzi, Some Rights Reserved
site map | recent changes | disclaimer