Basic HTML version of Foils prepared 2 Sept 1997

Foil 32 Setting up a cookie

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

1 Each cookie must have a key,value pair defining the cookie. In addition, there are optional fields defining the validity of cookie requests:
  • expires - gives the day and time in GMT up to which the browser should save the cookie.
  • path - sets the subset of the document space (URL's) on the server for which the cookie is valid.
  • domain - sets the domain for which the cookie is valid. Domains must have at least one ".", i.e. they can't be very general.
  • secure - setting this attribute requires that the cookie only be sent via a secure channel, Netscape's secure server, SSL.
2 Send one or more cookies using the Set-Cookie field in a header:

in Table To:


© 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