Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Different Locations with different cookies Apache::AuthCookie

Status
Not open for further replies.

MrCBofBCinTX

Technical User
Dec 24, 2003
164
US
I need to have three different locations on my site that have different cookies using Apache::AuthCookie.
I have had no trouble getting it to work well using the example form mod_perl cookbook, but now that I have added two new locations, I am getting the wrong cookie after a login attempt and thus no access. Not sure where the problem is at. Here is a section from my httpd.conf:

Code:
<Location /customer>
    AuthType Cookbook::Authenticate
    AuthName CUSTOMER_AREA-PRIVATE
    PerlAuthenHandler Cookbook::Authenticate->authenticate
    Require valid-user
    Options +IncludesNoExec +MultiViews
    SSLRequireSSL
</Location>
    PerlModule Cookbook::Authenticate
    PerlSetVar PGDB-PRIVATEPath /
    PerlSetVar PGDB-PRIVATELoginScript /perl/login.pl
    PerlSetVar PGDB-PRIVATEExpires +1h
    PerlSetVar PGDB-PRIVATESessionTimeout +15m
    PerlSetVar VPCP-DATABASE-PRIVATELoginScript /perl/login.pl
    PerlSetVar VPCP-DATABASE-PRIVATEPath /
    PerlSetVar VPCP-DATABASE-PRIVATEExpires +1h
    PerlSetVar VPCP-DATABASE-PRIVATESessionTimeout +15m
    PerlSetVar CUSTOMER_AREA-PRIVATEPath /
    PerlSetVar CUSTOMER_AREA-PRIVATELoginScript /perl/login.pl
    PerlSetVar CUSTOMER_AREA-PRIVATEExpires +1h 
    PerlSetVar CUSTOMER_AREA-PRIVATESessionTimeout +55m

<Location /login>
    AuthType Cookbook::Authenticate
    AuthName PGDB-PRIVATE
    SetHandler perl-script
    PerlHandler Cookbook::Authenticate->login
</Location>

<Location /logoff>
    AuthType Cookbook::Authenticate
    AuthName CUSTOMER_AREA-PRIVATE
    SetHandler perl-script
    PerlHandler Cookbook::Authenticate->logout
</Location>

# These documents require user to be logged in.
<Location /pgdb>
    AuthType Cookbook::Authenticate
    AuthName PGDB-PRIVATE
    PerlAuthenHandler Cookbook::Authenticate->authenticate
    Require valid-user
    Options +IncludesNoExec +MultiViews
    SSLRequireSSL
</Location>
<Location /login>
    AuthType Cookbook::Authenticate
    AuthName VPCP-DATABASE-PRIVATE 
    SetHandler perl-script
    PerlHandler Cookbook::Authenticate->login
</Location>
<Location /login>
    AuthType Cookbook::Authenticate
    AuthName CUSTOMER_AREA-PRIVATE
    SetHandler perl-script
    PerlHandler Cookbook::Authenticate->login
</Location>

<Location /logout>
    AuthType Cookbook::Authenticate
    AuthName VPCP-DATABASE-PRIVATE
    SetHandler perl-script
    PerlHandler Cookbook::Authenticate->logout
</Location>
<Location /perl/VPCP>
    SetHandler perl-script
    PerlHandler Apache::Registry::handler
    Options ExecCGI +SymLinksIfOwnerMatch
    PerlSetupEnv Off
    AuthType Cookbook::Authenticate
    AuthName VPCP-DATABASE-PRIVATE 
    PerlAuthenHandler Cookbook::Authenticate->authenticate
    Require valid-user             
    SSLRequireSSL
</Location>

When I try to login to the other two, I get a cookie for CUSTOMER_AREA-PRIVATE
trying to login to customer area does work just fine.
 
I have 3.14 installed and I am using with OpenBSD's version of Apache
 
I got this figured out, had to add some matches to the login.pl script and add stuff like /loginVPCP-DATABASE-PRIVATE
to the httpd.conf

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top