On 21-Oct-2000 James G Smith wrote:
> 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?

Exactly. I just didn't want to write it if somebody else had done it already ;-)


> 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

-- 
Jason Bodnar
[EMAIL PROTECTED]

Reply via email to