http://qs321.pair.com?node_id=697750

iavian has asked for the wisdom of the Perl Monks concerning the following question:

I have a mod_perl apache handler that either returns OK or redirects to login page.

redirection works fine
but when it returns OK , it doesn't continue parsing the actual requested file

Request -> http://localhost/index.php
Handler checks for username cookie
redirect if no cookie is available
Continue serving index.php if cookie is already available - I'm unable to achieve this

Please let me know if I'm missing anything

Replies are listed 'Best First'.
Re: Mod_perl Handler
by clinton (Priest) on Jul 15, 2008 at 16:24 UTC

    It depends how you've set up your handlers, but it sounds to me like your handler which checks the cookie should be returning DECLINED, not OK. OK means that the request is finished. DECLINED signals to apache that it should pass the request on to the next handler.

    See the mod_perl docs for more

      Yes , but it doest pass to next handler

      I have python cgi scripts along with mod_perl handler

      after mod_perl handler the control is not passed to mod_cgi

      any help?

        You haven't provided any details about how you've configured Apache, but I'm guessing that you're trying to use both mod_cgi and mod_perl for the PerlResponseHandler, and I don't think that will work.

        If you're using the mod_perl handler to check the cookie, why not put it into a separate phase, such as PerlAccessHandler. See the HTTP Handler docs for details.

Re: Mod_perl Handler
by olus (Curate) on Jul 15, 2008 at 17:54 UTC

    And then there are others that rely on the termination of the names of the scripts called to gather statistics about language use :)

    Now to your topic. You'll need to show us your code so that we can see what the problem is. Maybe some conditionals misuse?