I forgot to mention something:  the first time you access the script through your 
browser, it
won't have the cookie (since this is the first time it's being set).  The second time 
you access
it, the browser will return the cookie value and the script will display it.

> use strict;
> use CGI;
> my $q = CGI->new;
> 
> my $myCookie = $q->cookie( -name    => 'Fyre',
>                            -value   => 'blah,blah,blah',
>                            -expires => '+3M' );
> my $cookie_value = $q->cookie( 'Fyre' );
> print $q->header( -cookie => $myCookie ),
>         $q->start_html,
>         $q->p( "Test" );
> if ( ! $cookie_value ) {
>       print $q->p( "No cookie passed" );
> } else {
>       print $q->p( $cookie_value );
> }
>       print $q->end_html;


=====
Senior Programmer
Onsite! Technology (http://www.onsitetech.com/)
"Ovid" on http://www.perlmonks.org/

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Reply via email to