mod_auth and logoff

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
junky
Forum Commoner
Posts: 30
Joined: Wed Sep 03, 2003 3:58 pm

mod_auth and logoff

Post by junky »

hi guys, id like to kill a session authorized by mod_auth.
ive tried to unset($_SESSION), without success :(
i dont wanna close the browser, i just wanna the user re-confirm his password if he wants continue into the members' area.
thanks.
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

First of all, read the apache manual for mod_auth: http://httpd.apache.org/docs/howto/auth.html

You should know that mod_auth doesn't have anything to do with PHP sessions. Try unset the PHP_AUTH_USER and PHP_AUTH_PW variables, first, and watch what will happen.
junky
Forum Commoner
Posts: 30
Joined: Wed Sep 03, 2003 3:58 pm

Post by junky »

ive tried to:

Code: Select all

unset($_SERVERї'PHP_AUTH_USER']);
unset($_SERVERї'PHP_AUTH_PW'])
and its still the same.
its like the vars in $_SERVER are read-only.
any others solutions?
thanks
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

I've told something, that I shouldn't. Here's some extract from manual, to which I gave you this link.
Apache Manual FAQ wrote:How do I log out?
Since browsers first started implementing basic authentication, website administrators have wanted to know how to let the user log out. Since the browser caches the username and password with the authentication realm, as described earlier in this tutorial, this is not a function of the server configuration, but is a question of getting the browser to forget the credential information, so that the next time the resource is requested, the username and password must be supplied again. There are numerous situations in which this is desirable, such as when using a browser in a public location, and not wishing to leave the browser logged in, so that the next person can get into your bank account.

However, although this is perhaps the most frequently asked question about basic authentication, thus far none of the major browser manufacturers have seen this as being a desirable feature to put into their products.

Consequently, the answer to this question is, you can't. Sorry.
junky
Forum Commoner
Posts: 30
Joined: Wed Sep 03, 2003 3:58 pm

Post by junky »

thanks for the information delorian.
I thinking about an alternative way to do it.
if someone can help me, suggestions are welcome :)
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

http://php.net/manual/en/ref.session.php
http://php.net/manual/en/ref.http.php

as for start, and search for:

sessions cookies

on this forum. There're several topics about this stuff, and of course read some articles on the inter.net GS ->
http://www.google.com/search?q=php+auth ... 8859-1&lr=
junky
Forum Commoner
Posts: 30
Joined: Wed Sep 03, 2003 3:58 pm

Post by junky »

i think ive read enough to get that mod_auth isnt related to sessions in php nor to cookies.

its an extern module attached to apache web server.

we didnt find a way, so we'll keep trying to find a way :cry:
User avatar
delorian
Forum Contributor
Posts: 223
Joined: Sun May 04, 2003 5:20 pm
Location: Olsztyn, Poland

Post by delorian »

Hmm, By writing those links, I just gave you an alternative to mod_auth. There's no other option to authorize web-page user than mod_auth (mod_digest) OR sessions OR cookies when you are using Apache and PHP. So if you are saying that you read those, i think that now it should be simple to write your own simple(for begining) system. On this forum there are plenty of examples of doing it.
junky
Forum Commoner
Posts: 30
Joined: Wed Sep 03, 2003 3:58 pm

Post by junky »

thanks a lot for your support delorian.
its cause people like ya that i'll participate a bit more in this forum :)
continue your great job 8)
later
Post Reply