in reply to Password Protect Directory

What do you mean by "protecting a folder"? Creating an index in it, that will check the cookie? Or just forbid apache to browse folders?

Replies are listed 'Best First'.
Re^2: Password Protect Directory
by davidj01 (Novice) on May 04, 2010 at 17:28 UTC
    Hi,

    I want the user to log in via a web page to get access to any file under a specific folder.

    Lets call it /members

    Is there a way to get the web server to check that the user is logged in by checking a valid login cookie created by the login script then allow the user to access any web page or file under that folder.

    Thanks/David J

      You can include the checking script from all the files in the folder, or you can have just one script that checks the cookie and then does various things based on parameters (thence, the URLs will be like members/onescript.pl?show=secret instead of members/secret.pl; in such a case, do not forget to check that the value of the parameter is valid).
        Hi,

        I need a clarification of what you mean.

        Lets say I have 1000's of html files under /members

        I want to put static links to the html files.

        If the user did not log in from a web form then I want the web server somehow to know they are not logged in and brings up the login page.

        If the user did login from an html web page and created a a session cookie I want the web server to allow the access

        Thanks/ David J.