News · Links · Awards |
Cookie-lib.pl |
|
What is cookie-lib.pl?
|
||
Download | There is one version currently available. Version 0.913 Released 11/20/1998. |
|
News |
11/20/1998 - 8/24/1998 - 8/10/1998 - |
|
Documentation |
Version 0.911 contains 4 functions to help you manipulate cookies.
get_cookie
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: $cookie{name} = value
$cookie{'color'} = blue;
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 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. $path 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 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";
@cookies_to_delete = ("name","email","color");
Delete_cookie must be called before you print "Content-type: text/html\n\n";
@values = &split_cookie($cookie{'favorite'}); #returns all the values.
If you have any comments, questions, or modifications of the library, or you are successfully using the library, please contact me.
|
|
Links |
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. |
|
Awards |
|