
Jasmine
Administrator
/ Moderator
Dec 29, 1999, 5:13 PM
Post #3 of 4
(1965 views)
|
Fred-PK: Assuming you want to set a CGI (not JavaScript) cookie, it sounds like the easiest way for you to go is to grab a cookie library, or use the CGI module (use CGI qw/:standard :netscape/ . Two (free) cookie libraries are Cookie-lib.pl andHTTP Cookie Lib. Both of these libraries offer detailed information on how to set and delete cookies via your Perl CGI program. After you install your cookie library and incorporate the cookie-setting functions into your Perl program(s), the information in any of the cookies that you set will be available to all Perl programs you have on your server. For example, our sister company, YourDomainHost, offers a free month of domain hosting to any of their clients who refer a new client to them. To keep track of who referred who, special links that look like http://yourdomainhost.com/cgi-bin/welcome.pl?perlarchive are used. The welcome.pl program's sole responsibility is to dish out cookies. So whenever someone clicks on the special link and signs up, the ordering application looks for a cookie, and if there is one, credits the client who referred them. Is this the type of cookie usage you're looking for? Also, if you'd like to try the CGI module, an excellent tutorial is at webreview.com. The tutorial offers line-by-line instructions on how to set cookies using the CGI module. -Jasmine
|