Re: Unended login session!?
| From: | Chris Lee | Date: | Thu, 21 Jun 2001 14:48:12 +0000 |
| Subject: | Re: Unended login session!? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-54744@lists.php.net to get a copy of this message | ||
Header("WWW-Authenticate: Basic realm='$SERVER_NAME' ");
Header("HTTP/1.0 401 Unauthorized");
exit();
this forces all my clients to re-login. you can not log someone out be
changing the value off PHP_AUTH_USER because that variable is set by the
client everytime the page is loaded. you can change it all you want, but the
client wont know your changing it. thus wont care. hehe
I assume thats just a typo you made on the post, not in your code.
"HTTP/1.0" not "HTTP/1,0" on a comment I need both those lines, not just
one. Ive been told, never needed to, that another sure way to log someone
out is to change the realm.
function mtime()
{
$mtime = microtime();
$mtime = str_replace('.', '', $mtime);
$mtime = explode(' ', $mtime);
$mtime = $mtime[1] . $mtime[0];
return($mtime);
}
Header("WWW-Authenticate: Basic realm='". mtime() ."' ");
Header("HTTP/1.0 401 Unauthorized");
exit();
--
Chris Lee
lee@mediawaveonline.com
""Cefull Lo"" <cefull_lo@yahoo.com> wrote in message
news:9gs89c$u29$1@w153.z064000151.sjc-ca.dsl.cnc.net...
> When I use the follow code to make a member login,
>
> header ("WWW-Authenication: basic realm='my login'");
>
> Once you are logined, the session seems never end. (ie $PHP_AUTH_USER
exist
> forever until you close the browser). Is it any way to put an end on this
> session and let people login with another name?
>
> The follow methods are tried and not work.
>
> header("HTTP/1,0 401 Unauthorized"); while logout clicked;
> $PHP_AUTH_USER=$PHP_AUTH_PW="";
>
> Thanks
>
> Cefull Lo
>
>
> --
> content-type:kiss/hug
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>