NYCPHP Meetup

NYPHP.org

[nycphp-talk] Auth sessions

Matthew Terenzio webmaster at localnotion.com
Mon Aug 9 18:24:53 EDT 2004


I'm using PHP 5, postgresql and Pear Auth.

if I use a table named auth with fields called username and password 
(defaults) then the typical code works fine:

require 'Auth/Auth.php';
$opts = array('table' => 'auth',  'cryptType' => 'none',  'dsn' => 
'pgsql://db_user:db_pass@db_host/db_name');
$a = new Auth('DB', $opts);
//$a->setShowLogin(false);
$a->start();  

I can login, go to google, return and I'm still logged in.

However when changing $opts to reflect my database, the session won't 
stick. I can login and retrieve my user info, but like I said, If I 
leave and return, I'm logged out.

here is the (faulty?) $opts :

$opts = array('table' => 'users',  usernamecol => 'email', 
'passwordcol' => 'pass', 'cryptType' => 'none',  'dsn' => 
'pgsql://db_user:db_pass@db_host/db_name');

By the way, cryptType of none is just for testing. : )


Thanks for any help,

Matt Terenzio



More information about the talk mailing list