Hi
Sorry, cause I don't have enough time, to look at your problem now, but I
wrote this function a few months ago, it seems to works fine, so If you want
to give it a try, It may be useful for everybody
This function joins both tasks in one, it closes the session, calling
page_close(), and automatically redirect to the URL you pass in, everything
I do, is calling it in every page I want to add a logout feature, tipically
my scripts looks like:
page_open();
// the line below runs everytime you enter this page, but it will do logout,
only in case it gets the $logout==true, i.e taken from GET_VARS
//
page_close_logout($url,$query_string,$logout)
// Your script code
page_close()
function page_close_logout($url="",$qstring="",$logout=false){
global $auth;
global $PHP_SELF;
global $QUERY_STRING;
if($url=="") $url = $PHP_SELF;
if($qstring=="") $qstring = $QUERY_STRING;
if(is_login() && $logout==true){
modify_url("$url?$qtring","logout","");
$auth->logout();
page_close();
// echo "$url?$qtring";
header("Location: $url?$qtring");
}
}
function is_login(){
global $sess;
global $auth;
$uid= isset($auth)?$auth->is_authenticated():false;
return ($sess->is_registered("auth") and ($uid!=false) and
$uid!="form");
}
Hope this help
Lazaro
----- Original Message -----
From: Patrick Haggood <te...@co...>
To: <php...@li...>
Sent: Monday, December 10, 2001 12:54 PM
Subject: [Phplib-users] Re: Phplib-users digest, Vol 1 #90 - 1 msg
> Is there a better way to log someone out from your pages? I'm having
> intermittent security holes popup when someone logs out from my pages
> but then hits 'back' a bunch of times.
>
>
> _______________________________________________
> Phplib-users mailing list
> Php...@li...
> https://lists.sourceforge.net/lists/listinfo/phplib-users
>
>
>
|