It might be easier (and simpler) to use a challenge cookie sent from the server and then checked by subsequent pages, where cookies are required, rather than depend on JavaScript.


In the first script:

my $c = new CGI::Cookie( -name => 'test_cookie' -value => "1", -path => "/" );
$r->err_headers_out->add( 'Set-Cookie' => $c );



In the second script:

my $cookies = fetch CGI::Cookie;
handle_error( "Cookies must be enabled, etc" )
   unless( exists $cookies ->{ test_cookie } );





Mike Ward wrote:

Hi.

I'm having some problems with users and cookies, although I'm not
quite sure what's going on with it. On a front page, I have a bit of
javascript that sets and immediately after reads a cookie, to check
that cookies are enabled. This works fine for me in Firefox on both
linux and windows, and IE 6. However, this doesn't always seem to
catch it, and users are allowed to log in anyway, and errors are
generated in code that referances cookies that are made when they log
in.

Stranger still, their IE privacy settings seem to be just fine - Set
to "medium", and sometimes even explicitly allowing cookies from our
site.

Has anyone else had similar problems, or know of any resources that
might be of use? ANy help is appreciated.

Thanks in advance,
Mike




-- Report problems: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html List etiquette: http://perl.apache.org/maillist/email-etiquette.html



Reply via email to