CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Need a Custom or Prewritten Perl Program?: I need a program that...: Re: [RedRum] Cookies 2: Edit Log


Mar 3, 2002, 12:57 PM

Views: 9452
Re: [RedRum] Cookies 2

...This should actually be posted in the beginner/immediate forum...

I throught this does the trick:
use CGI qw(:cgi);
my $times = cookie('Cookie_Name') || 0;

if($times > 5) {
print redirect('some_url'); # Your redirect needs to be printed to the browser.
else {

sub set_cookie
my $cookieObj = cookie(-name => 'Cookie_Name', -value=> $times);
print header( -cookie => $cookieObj ); # Send cookie with HTTP header

btw, use CGI qw(:cgi); would be enough for CGI programs. (unless you want to generate HTML through the

Yet Another Perl Programmer

~~> [url=] <~~
More then 3500 X-Forum [url=]Downloads! Cool

(This post was edited by yapp on Mar 3, 2002, 12:59 PM)

Edit Log:
Post edited by yapp (User) on Mar 3, 2002, 12:59 PM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives