Re: LiveUser - Cookie gets set but Session won't start
| From: | Hector Partidas | Date: | Thu, 06 Apr 2006 16:27:18 +0000 |
| Subject: | Re: LiveUser - Cookie gets set but Session won't start | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-23557@lists.php.net to get a copy of this message | ||
Ok, i figured out an error on the $conf array and fixed it, its now properly
set up. How ever, i still can't get this to work.
I've been digging into the Code itself. Here are some things i've come up
with which i don't know why they happen.
on line 1004 $containerNames = array_keys($this->_authContainers); for my
$conf, it returns 2 keys despite there is only 1 containers (working as
intended?)
After the foreach is done, on line 1048 if (!$this->isLoggedIn()) { -- this
is where the problem comes in, before this line, $login == 1 post that it
returns false.
I was reading over the login function and it doesn't set $this->_auth, so as
soon as it hits that line it boots me.
Another thing i noticed is that the DSN was parsed properly, sadly i can't
find where exactly the info was at, but the database value was empty in the
array containing all the dsn info:
phptype => mysql
host => localhost
user => root
password =>
database =>
the DSN is as follows: mysql://root:@localhost/test
On 4/6/06, Hector Partidas <hectortuwebfacil@gmail.com> wrote:
>
> Hello folks,
>
> I've been playing around with live user for a bit (couple of days or so)
> how ever, i can't get it to work. After much testing and playing around,
> i've become a bit frustrated since the basic configuration isn't working. So
> i'm going to go over what i did to see if someone can point me in the right
> direction.
>
> Ok, I installed LU Tables from the install.php, and used this conf array:
>
> $conf = array(
> 'authContainers' => array(
> array(
> 'type' => 'MDB2',
> 'expireTime' => 1800,
> 'idleTime' => 300,
> 'storage' => array(
> 'dsn' => $dsn,
> 'force_seq' => false,
> 'alias' => array(
> 'auth_user_id' => 'authUserId',
> 'lastlogin' => 'lastLogin',
> 'is_active' => 'isActive',
> 'owner_user_id' => 'owner_user_id',
> 'owner_group_id' => 'owner_group_id',
> ),
> 'fields' => array(
> 'auth_user_id' => 'integer',
> 'lastlogin' => 'timestamp',
> 'is_active' => 'boolean',
> 'owner_user_id' => 'integer',
> 'owner_group_id' => 'integer',
> ),
> 'tables' => array(
> 'users' => array(
> 'fields' => array(
> 'lastlogin' => null,
> 'is_active' => null,
> 'owner_user_id' => null,
> 'owner_group_id' => null,
> ),
> ),
> ),
> ),
> ),
> ),
> 'permContainer' => array(
> 'type' => 'Complex',
> 'storage' => array(
> 'MDB2' => array(
> 'dsn' => $dsn,
> 'prefix' => 'auth_',
> 'force_seq' => false,
> 'fields' => array(
> 'auth_user_id' => 'integer',
> ),
> )
> )
> )
> );
>
> Ok It installed and what not. I added a user and tried to login to it
> (downloaded the tutorial files from gvngroup.be ) using the following
> array:
>
> $conf =
> array(
> 'autoInit' => true,
> 'debug' => true,
> 'session' => array(
> 'name' => 'TWF', // liveuser session name
> 'varname' => 'ludata', // liveuser session
> var
> name
> 'force_start' => true
> ),
> 'login' => array(
> 'force' => false // should the user be
> forced to login
> ),
> 'logout' => array(
> 'destroy' => true // whether to destroy
> the session on logout
> ),
> 'cookie' => array(
> 'name' => 'loginInfo', // name of the Remember me cookie
> 'lifetime' => 30, // cookie lifetime in days
> 'path' => null, // cookie path ?
> 'domain' => null, // cookie domain ?
> 'savedir' => '.', // absolute path to writeable
> directory ?
> // (no trailing slash)
> 'secure' => false, // whether cookie only send over
> secure connection
> ),
> 'authContainers' => array(
> 'MDB2' => array(
> 'type' => 'MDB2',
> 'expireTime' => 1800,
> 'idleTime' => 300,
> 'storage' => array(
> 'dsn' => $dsn,
> 'force_seq' => false,
> 'alias' => array(
> 'auth_user_id' => 'authUserId',
> 'lastlogin' => 'lastLogin',
> 'is_active' => 'isActive',
> 'owner_user_id' => 'owner_user_id',
> 'owner_group_id' => 'owner_group_id',
> ),
> 'fields' => array(
> 'auth_user_id' => 'integer',
> 'lastlogin' => 'timestamp',
> 'is_active' => 'boolean',
> 'owner_user_id' => 'integer',
> 'owner_group_id' => 'integer',
> ),
> 'tables' => array(
> 'users' => array(
> 'fields' => array(
> 'lastlogin' => null,
> 'is_active' => null,
> 'owner_user_id' => null,
> 'owner_group_id' => null,
> ),
> ),
> ),
> ),
> ),
> 'permContainer' => array(
> 'type' => 'Complex',
> 'storage' => array(
> 'MDB2' => array(
> 'dsn' => $dsn,
> 'prefix' => 'auth_',
> 'force_seq' => false,
> 'fields' => array(
> 'auth_user_id' => 'integer',
> ),
> ),
> ),
> ),
> ),
> );
>
> Now, after all is said and done, and i try to login, i realize that a
> cookie is set with this data:
>
> [TWF] => 41ea75be21f1c5b3bb0492f26079f425
>
> Which should be Session ID, how ever, it simply won't log in. I really
> don't know how to go about this, I spoke with lukas and he said the config
> arrays were set up accordingly (i showed him atleast 3 different ones i
> tried), So i really don't know how to go about this, hope someone has a more
> of a clue than me =)
>
> --
> Atentamente,
> H�ctor Partidas
> Desarrollador
> tuWebFacil.com
>
--
Atentamente,
Héctor Partidas
Desarrollador
tuWebFacil.com