Hi Andrew Brosnan,
you are right it was perl,, I was just to tired..sorry. ( it is 4 in the morning here)

I have changed the code you sent a little bit and now it works on my server, so thanx 
for helping out.

Regard Ahrent Soendergaard

I ended up with


 use CGI::Cookie;
use CGI qw/:standard/;
my $query = new CGI;

$c = new CGI::Cookie(-name =>'test',
                                -value => 'testing user settings'
                                );
                                                
print header (-cookie=>$c);

my $cookie = $query->cookie('test');

if ($cookie) {
    print "ok";
        #they have my cookie!
  }
  else{
       #no cookie...tell them to enable cookies
      print "not ok";
}



======= At 2003-06-06, 21:44:00 you wrote: =======

>what I wrote was perl; just suggesting javascript since it is easier to
>check if cookies are enabled rather than set.
>
>
>
>On 3/9/03 at 3:30 AM, [EMAIL PROTECTED] (Ahrent) wrote:
>
>> Hi Andrew Brosnan,
>>
>> Thanks for the code, but I do not like javascript for this work,
>> since not all users can use it.
>>
>> Regards Ahrent Soendergaard
>>
>>
>>
>> ======= At 2003-06-06, 21:25:00 you wrote: =======
>>
>> >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]
>>
>> = = = = = = = = = = = = = = = = = = = =
>>
>>
>> Vi Ses.
>> Ahrent
>>
>> 2003-03-09
>>
>>
>>
>>

= = = = = = = = = = = = = = = = = = = =
                        

Vi Ses.                         
Ahrent

2003-03-09




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

Reply via email to