473,806 Members | 2,607 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

unsetting PHP_AUTH_USER and PHP_AUTH_PW

34 New Member
How do I unset PHP_AUTH_USER and PHP_AUTH_PW?
I am trying to create a logout script and I am encountering a problem where when go to relogin, I am already logged in.

In my logout script, I started a session, unset(session), and then destroy_session (). But, everytime I go back to the login link, It does not give me the window popup for the login information.

Only when I close the brower and then try logging in does the popup window ask for the PHP_AUTH_USER and PHP_AUTH_PW.


Please help.
May 23 '07 #1
2 4211
Motoma
3,237 Recognized Expert Specialist
How do I unset PHP_AUTH_USER and PHP_AUTH_PW?
I am trying to create a logout script and I am encountering a problem where when go to relogin, I am already logged in.

In my logout script, I started a session, unset(session), and then destroy_session (). But, everytime I go back to the login link, It does not give me the window popup for the login information.

Only when I close the brower and then try logging in does the popup window ask for the PHP_AUTH_USER and PHP_AUTH_PW.


Please help.
Perhaps you could post your logout code?
May 24 '07 #2
pbmods
5,821 Recognized Expert Expert
As a sidenote, it is recommended that you NOT use register_global s.

Take a look at the comments at the bottom of this page for some ideas on how to do it. It looks to be somewhat of a tricky process, and a couple of developers have reported that it just refuses to work short of closing the browser window.
May 25 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
6778
by: Andrew Brett | last post by:
I'm trying to get PHP authentication (using the headers to request authentication, and then checking $_SERVER and $_SERVER) - however, no matter what I do, I can't seem to get it to work. The login request box pops up fine, but when I enter the correct details, it just pops back up again, and then again, before finally dumping me at the authentication failed page. I've tried looking at phpinfo(), and PHP_AUTH_USER and PHP_AUTH_PASSWD are...
6
12731
by: TooN | last post by:
Hi, I'm building an application with over 10thousand database entries. I was wondering if it would be useful, regarding memory load and server performance to unset/destroy objects at the moment when they are no longer needed. Will this improve performance, or will it not make any difference. Thanks for any help.
2
4365
by: Timo Steinbach | last post by:
Hi, I use basic authentication in Apache. I like to use the global variable $_SERVER. Unfortunately this variable is empty/no availabe. Same with PHP_AUTH_PW. AUTH_TYPE is working and states "Basic". Can somebody help me with this? Thanks Timo
5
10895
by: BT3 | last post by:
(newbie) I have taken some code directly out of a book: <?php // if we are using IIS, we need to set $PHP_AUTH_USER and $PHP_AUTH_PW if (substr($SERVER_SOFTWARE, 0, 9) == 'Microsoft' && !isset($PHP_AUTH_USER) && !isset($PHP_AUTH_PW) && substr($HTTP_AUTHORIZATION, 0, 6) == 'Basic '
1
5816
by: jerrygarciuh | last post by:
Hello, I am finding that on a new server where I am developing $_SERVER and $_SERVER Do not show up in $_SERVER when I when they should be defined I test using print_r($_SERVER) or this
3
2835
by: Bernard Higonnet | last post by:
I'm running Apache/2.0.52 (Unix) mod_perl/1.99_16 Perl/v5.8.5 PHP/5.0.1 under FreeBSD 4.11-RELEASE #0. I suddenly (sic) no longer have PHP_AUTH_USER, PHP_AUTH_PW, and AUTH_TYPE or REMOTE_USER or any such variables. They do not show up in phpinfo() nor do they work as expected programmatically. I used to have them a few weeks ago. I have not changed any of versionned packages shown above in months.
1
3908
by: rbragg | last post by:
In my db, I have the fields user and pass with one record. With the following code, I get a continuous dialog box display. If I put in a bogus user/pass OR the correct user or pass, the dialog box pops up again. <?php //assume user is not authenticated $auth = false; $user = $_SERVER;
17
1747
by: Shelly | last post by:
I have the following for a test of the submit button being pressed: if (isset($_POST)) { This works fine and I have been doing this for a long time. Here is the question: If I do a submit and have it come back to the same page, all is fine. If I now click the browser refresh button, I get another submittal. How do I "unset" the status so that it doesn't think I clicked the submit button when
8
5133
by: Mark Reed | last post by:
I have an Apache 2.2.8 server all set up with mod_authnz_ldap to authenticate via LDAP user/password pairs. It's all SSL to the web server, SSL between the web server and LDAP, so it's pretty secure even though it's Basic auth. By the time the PHP script runs, the user has already authenticated and the PHP code can trust the value of PHP_AUTH_USER. So, how can I NOT have PHP_AUTH_PW set? I'd kinda rather not have people's passwords...
0
9719
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9597
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10369
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10372
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10110
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9187
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5682
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4329
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3851
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.