note 16046 added to features.http-auth

From: Date: Sun, 14 Oct 2001 15:01:34 +0000
Subject: note 16046 added to features.http-auth
Groups: php.notes 
Request: Send a blank email to php-notes+get-18903@lists.php.net to get a copy of this message
Hi all. I just want to say few words about RELOGIN button. Which can be enabled with HTTP authentication. I think after previous few words you will read this text more attentively :-) So if you wish to use this feature you will have to use SESSIONS (PHP Sessions are good). 1. Generate var LOGINED and set it to false. 2. If user login was good set var LOGINED to true. 3. make session var RELOGIN 4. Use link index.phtml?relogin=1 5. Perform check: // relogin block if ( (isset($relogin)) && ((isset($RELOGIN))&&(!$RELOGIN)) ) { $RELOGIN=true; $LOGINED=false; } elseif ($LOGINED) { $RELOGIN=false; } // here show user if (!$LOGINED) { Header("WWW-authenticate: basic realm="SpyLOG"); Header("HTTP/1.0 401 Unauthorized"); exit; } -- http://www.php.net/manual/en/features.http-auth.php http://master.php.net/manage/user-notes.php?action=edit+16046 http://master.php.net/manage/user-notes.php?action=delete+16046 http://master.php.net/manage/user-notes.php?action=reject+16046

« previous php.notes (#18903) next »