Re: php htaccess logins and logouts
| From: | James McLean | Date: | Thu, 26 Nov 2009 22:16:58 +0000 |
| Subject: | Re: php htaccess logins and logouts | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300130@lists.php.net to get a copy of this message | ||
On Fri, Nov 27, 2009 at 12:12 AM, Ashley Sheridan
<ash@ashleysheridan.co.uk> wrote:
> Hi all,
>
> I've got a site set up that is using an htaccess file to provide secure
> access to a directory. That is working fine. What I wondered was, is
> there a way to log out via PHP. As I understand it, the login mechanism
> is part of Apache, so I guess what I'm really asking is, is there a way
> that I can get Apache to end the 'session' that Apache has set up, using
> PHP?
>
> I'm sure I've seen cPanel do it, so I was wondering how easy this would
> be to do myself.
IIRC if you unset $_SERVER['PHP_AUTH_USER'] and
$_SERVER['PHP_AUTH_PW'] it will log you out.
Cheers.