News · Links · Awards
|What is cookie-lib.pl?
|Download||There is one version currently available.
Version 0.913 Released 11/20/1998.
Version 0.911 contains 4 functions to help you manipulate cookies.
To read the cookies, simply call the subroutine "get_cookie" from anywhere in your script (after you require "cookie-lib.pl"). Cookies are stored in an associative array like so:
The arguments are as follows:
Expiration date of the cookie, expressed in unix time format (seconds since Jan 1, 1970). All expiration dates are in Greenwich Mean Time. (Keep this in mind.)
If you don't want to set any expiration, then use $expiration = "-1".
If you want a "permanent" cookie (it lasts until 12/31/1998) then set $expiration = ""
Domain that the cookie data can be sent back to. Ordinarily you would leave this blank or $domain = "". This allows only you to read the cookie.
Any file contained within $path (and it's subdirectories) can retreive the data contained within the cookie. For all pages on your server use "/", however in case of a subdirectory "/subdirectory".
Secure can either be equal to 0 or 1. If it's not a secure cookie, you can either leave it out, or $secure = 0. If for some reason you want to use secure cookies, set $secure = 1.
Set_cookie must be called before you print "Content-type: text/html\n\n";
Delete_cookie must be called before you print "Content-type: text/html\n\n";
If you have any comments, questions, or modifications of the library, or you are successfully using the library, please contact me.
Netscape's cookie spec: http://home.netscape.com/newsref/std/cookie_spec.html.
Cgi-lib.pl homepage: http://cgi-lib.stanford.edu/.
General Cookie info: http://www.illuminatus.com/cookie.fcgi.
More general cookie info: http://www.cookiecentral.com/.
Like this? Check out my other software on my homepage.