Re: Auth Problem ...

From: Date: Tue, 02 Apr 2002 09:48:41 +0000
Subject: Re: Auth Problem ...
Groups: php.pear.dev php.pear.general 
Request: Send a blank email to pear-dev+get-5159@lists.php.net to get a copy of this message
At 07:38 26/03/02 +0100, Martin Jansen wrote:
It looks like there are some problems with PEAR::Auth & 4.1.2, eventhough I can't reproduce them :-(. I'll try to find a fix for that later this week.
Hello Martin, On a test install (win 98 Apache 1.3.24 / php 4.1.2) if I do the very simple following (files content at the end of this message) 1) First use : authentication works ok no problem
    content of the session file : !auth
    but I can't access Auth session variables in the following pages
    if (isset($_SESSION)) { print_r( $_SESSION );  } gives an empty array();
2) if I add another session variable ($me = 'luc') when I get back to the index page I get a "Warning: Undefined index: auth in T:\EasyPHP\www\include\Auth\Auth.php on line 513" on the index.php file
    and I can't access Auth session variables in the following pages
     if (isset($_SESSION)) { print_r( $_SESSION );  } gives a value for $_SESSION['me'] only
     content of the session file : !auth|me|s:3:"luc"
In case this is of some importance, I use register_globals = Off (because it will be the default..) Luc =========file auth_setup.php======================= <?php ini_set("include_path", "T:\EasyPHP\www\include"); require_once "Auth/Auth.php"; $params = array(
            "dsn" => "mysql://user:pass''@server/db",
                        "table" => "foo_table",
                        "usernamecol" => "foo_user_name",
                        "passwordcol" => "foo_password"
                        );
function loginFunction() { echo "<form method=\"post\" action=\"" . $_SERVER['PHP_SELF'] ."\">";
        echo "<input type=\"text\" name=\"username\"><br>";
        echo "<input type=\"password\" name=\"password\"><br>";
        echo "<input type=\"submit\" value=\"Envoi\">";
        echo "</form>";
} // create auth object $myauth = new Auth("DB", $params, "loginFunction"); ?> ============ EOF ================================== and ============ file index.php ============================ <?php session_start(); include 'lib\auth_setup.php'; $myauth->start(); if ($myauth->getAuth()) {
        echo "Hello <strong> ".$myauth->getUsername()."</strong> !<br />\n".
                 "You've been detected.\n".
                 "Click <a href=\"see_session.php\">here</a> to see the session variables";
        }
?> ============ EOF =================================== ================ file see_session.php ================== <?php session_start(); if (isset($_SESSION)) { print_r( $_SESSION ); } ?> ============== EOF ================================

« previous php.pear.dev (#5159) next »