Jason Bodnar <[EMAIL PROTECTED]> wrote:
>Is there a module for simple cookie authorization? I want to grant access if
>the user has a cookie set. I don't care about the value of the cookie.
>
>I looked at Apache::AuthCookie and it looks overly complex for my needs.

Something like the following?



package My::CookieAuth;

use strict;
use Apache::Constants qw(:common);
use CGI qw(:standard);
use CGI::Cookie ();

sub handler {
  my $r = shift;

  return DECLINED unless cookie(COOKIE_NAME);
  return OK;
}

__END__




In httpd.conf, you will need to set this as the PerlAuthenHandler 
for the protected files/directories and `require any' to get Apache 
to actually call it.  This is not the most efficient, but it could 
be a starting point for what you're looking for, if I understand 
what you're looking for.
-- 
James Smith <[EMAIL PROTECTED]>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix

Reply via email to