Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8003081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T16:33:37+00:00 2026-06-04T16:33:37+00:00

Apache 2.2, php 5.3 I can log on successfully, but how can I logoff?

  • 0

Apache 2.2, php 5.3

I can log on successfully, but how can I logoff?

in apache config:

<Directory /www/domain.com/adm>
    AuthName "MySQL group authenticated zone"
    AuthType Basic

    AuthMYSQLEnable on
    AuthMySQLUser user
    AuthMySQLPassword password
    AuthMySQLDB dbname
    AuthMySQLUserTable users
    AuthMySQLNameField email
    AuthMySQLPasswordField pass
    AuthMySQLGroupField group
    AuthMySQLUserCondition " status='on'"
</Directory>

After successfull login, apache sets $_SERVER[PHP_AUTH_USER] but it’s impossible to change/unset this value;

apache_setenv('PHP_AUTH_USER', ''); and session_destroy(); don’t work too;

Header("HTTP/1.0 401 Unauthorized"); doesn’t do anything, at least for my FF12;

If I put another authenticate request with 401:

Header("WWW-Authenticate: Basic realm=\"My Realm\"");
Header("HTTP/1.0 401 Unauthorized");

it produces login form but I just want to redirect user outside of /adm without asking for password again!

I was reading http://www.php.net/features.http-auth for a long time but either I miss something (perhaps very obvious) or it was helpless.

So how can I logoff / logout?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T16:33:41+00:00Added an answer on June 4, 2026 at 4:33 pm

    As soon as no glue for three weeks – I just discard the nice idea to use mysql_auth_module and fall back to generic auth.

    In case you have any ideas – you are welcome.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

PHP via CLI successfully logs errors to /var/log/php_errors.log. But apache + php does not
Good time of day! I successfully used apache + php on windows 7, but
How can I setup expires headers in PHP + Apache? I'm currently using an
Haxe has Apache httpd modules and can compile to PHP code. These are 2
Is it possible to deny from all apache htaccess style using php. I can't
I need to run Linux-Apache-PHP-MySQL application (Moodle e-learning platform) for a large number of
I have a LAMP (Linux/Apache/MySQL/Php) application that I should release soon. Even if I've
I need to monitor HTTP traffic in my dev env which is PHP/Apache/Windows. But
I'm working on a PHP contact form, but I can't get it to work.
I have an existing large(ish) PHP web app (using Apache and MySQL) which now

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.