Re: PHP and .HTACCESS
| From: | Chris Shiflett | Date: | Fri, 03 Oct 2003 16:11:53 +0000 |
| Subject: | Re: PHP and .HTACCESS | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-164931@lists.php.net to get a copy of this message | ||
--- "James D. Stallings" <jim@mcws.net> wrote:
> I user goes to www.mysite.com and clicks on a link called STAFF
> The STAFF.mysite.com is protected with authentication using
> .htaccess The staff enters their ID and Password and is allowed in.
> I want to have a button that says LOGOFFF that will remove the
> authentication
HTTP authentication is not a very good tool for implementing sophisticated
access control. Though it is possible to simulate a log out, it is not very
straightforward (some would call it a hack), because there is no mechanism for
the server to instruct the browser to forget the authentication credentials.
So, I recommend using PHP sessions instead.
However, if you really want/need to use HTTP authentication, you can read this
page to get some other users' suggestions:
http://www.php.net/features.http-auth
Hope that helps.
Chris
=====
My Blog
http://shiflett.org/
HTTP Developer's Handbook
http://httphandbook.org/
RAMP Training Courses
http://www.nyphp.org/ramp