Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Logging out of .htaccess

Status
Not open for further replies.

BenRussell

Programmer
Joined
Mar 12, 2001
Messages
243
Location
US
I have a place on my website where users can login using a .htaccess/.htpasswd file. I need to know, however, how they can logout, so Apache will not recognize them anymore so they can login again. - Ben Russell
- President of Intracor Technologies (
 
I'm not sure that one can log out of .htaccess short of closing the browser but if there is, I would also like to know how to do it. Don
don@ctagroup.org
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT (only when I have to!)
 
Are you sure that your PHP administration is using .htaccess or does it have its own authentication facility that happens to use the .htpasswd file? That is the most common way of doing it. As far as I know, you can't log out of .htaccess because you are not technically logged in to anything. .htaccess just lets you in (or not) but doesn't store the fact that you are there anywhere so there is nothing from which to log out. Some browsers might keep it as part of their cache but .htaccess itself does not. Don
pc@accesscom.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT (only when I have to!)
 
Yes, you can but I'm not a programmer so maybe someone else can tell you how it's done. I can tell you only in very general terms that you would have to query the authentication database based on a username and password from a form (not the .htaccess popup - that's not a form in the strict sense) then make a comparison to see if there's a match. I played around with myPHPadmin some time ago at home but don't have it here at the office. Don
pc@accesscom.com
Experienced in HTML, Perl, VBScript, PWS, IIS and Apache. Run OS/2 Warp 4, BeOS v5 and Windows NT (only when I have to!)
 
If you're using .htaccess, you're using what's called "basic authentication" and it's all handled between the browser and the web server - the perl program never has anything to do with it. The browser gets a basic authentication request from the server, prompts you for a userid and password, and resends the request with a basic authentication header containing the userid and password (poorly) encrypted back to the server. It continues to send that basic authentication header until you close the browser, change to a different domain, or change to a directory that needs a different userid/password. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top