On 3/9/03 at 2:51 AM, [EMAIL PROTECTED] (Ahrent) wrote:

> Hi Iím looking for a function/module to check if visitors have their
> cookies enabled when they come to my site.

A little Javascript may be better for your purpose; but consider:


    use CGI;

    my $q = new CGI;

    my $cookie = $q->cookie('session');
    
    if ($cookie) {
        #they have my cookie!
    }
    else{
        #no cookie...better set one
        $cookie = 'my_cookie_value';
        my $cookie = $q->cookie( -name   => 'session',
                                 -value  => $cookie,
                                 -expires => '3h' );
        print $q->header( -cookie => $cookie);
    }


Regards
Andrew

--

  This post is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  Any code 
  contained herein is likely UNTESTED and may cause your system 
  to explode upon execution.  Furthermore, please be advised that
  I am really just a Perl ninny, and you probably should not be 
  taking my advice in the first place.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to