Is It Possible To Set A Cookie And Then Redirect A Return Visitor To A Different Url All Using Cgi

Is It Possible To Set A Cookie And Then Redirect A Return Visitor To A Different Url All Using Cgi


  • 14 Dec, 2011

    Try:#! /usr/bin/perl -wuse CGI qw(:cgi);my $q = CGI->new();my $cookie = $q->cookie( -name => 'yummy_cookie', -value => 'chocolate chip', -domain => '.globalguideline.com', -expires => '+10d', -path => '/' );print $q->redirect( -url => 'http://www.globalguideline.com', -cookie => $cookie );__END__If you leave out the "-domain", and "-path", then they will default to current values. The above example will be returned to all servers in the irt.org domain.If you leave out the "-expires", then the cookie will expire when the user closes their browser. The above expires after 10 days.

    Comments Received:
    Please give your suggestions and feedback:

2009-2016 downloadmela.com. All rights reserved.