Basic HTML version of Foils prepared 2 Sept 1997

Foil 33 Retrieving a cookie

From CGI Programming with Advanced Topics Jackson State University Mississippi -- Fall Semester 97. by Nancy McCracken *

If any request for a document or script satisfies the validity requirements, then an environment variable HTTP_COOKIE is set to have all the cookie values.
Cookies are key, value pairs and are encoded just like all other fields, EXCEPT that they are separated by ; (instead of &).
in Perl: $ENV{'HTTP_COOKIE'}
could have the value: full+name=Max+Planck;Occupation=physicist
This can be decoded in a similar fashion as the standard ReadParse subroutine, except that you must split the fields on ";".



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Tue Sep 2 1997