Date: 03/20/00
- Next message: Spruce Weber: "Re: [PHPLIB] Loginfields on the indexpage..."
- Previous message: Chris Cochella: "Re: [PHPLIB] Loginfields on the indexpage..."
- Next in thread: Alexander Aulbach: "Re: [PHPLIB] Error using different DBs for sess and auth"
- Reply: Alexander Aulbach: "Re: [PHPLIB] Error using different DBs for sess and auth"
- Reply: Philip Strnad: "Re: [PHPLIB] Error using different DBs for sess and auth"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I've set up session and auth classes to go to two different databases like
so:
/************************************************/
class Mission_CT_Sql extends CT_Sql
{
var $database_class = 'SessionDB'; // DB just for session info
var $database_table = 'active_sessions';
}
class Mission_Session extends Session
{
var $classname = 'Mission_Session';
var $cookiename = '';
var $magic = 'Umuarama';
var $mode = 'get'; // notice I'm trying to perpetuate
var $fallback_mode = 'get'; // session IDs using get
var $allowcache = 'no';
var $lifetime = 1440;
var $that_class = 'Mission_CT_Sql';
var $gc_probability = 25;
}
class Mission_Challenge_Auth extends Auth
{
var $classname = 'Mission_Challenge_Auth';
var $lifetime = 1;
var $magic = 'Oogachaka';
var $database_class = 'MissionDB'; // DB for user stuff and everything
else
var $database_table = 'user'; // same as auth_user with different
name
... // rest of the default stuff for authentication
}
/************************************************/
On my page I'm calling:
/************************************************/
require 'mission.inc'; // page where all the stuff is declared
page_open(array('sess' => 'Mission_Session',
'auth' => 'Mission_Challenge_Auth',
'perm' => 'Mission_Perm')); // also declared in
mission.inc
$perm->check('admin');
/************************************************/
When I try to log in and I put in a non-existing user, I get the usual
error, but it posts back to the login form with Mission_Session variable set
(for example Mission_Session=a15e53a12389d4d2e635182d1f4c736f). First of
all, why does it create a session if I haven't even successfully logged in
yet? This is different from the way it used to work in PHPLIB 6.1.
Also, at the bottom of the login form I get the following error:
Database error: Invalid SQL: update active_sessions set
val='TWlzc2lvbl9TZXNzaW9uOiR0aGlzLT5pbiA9ICcnOyAkdGhpcy0+cHQgPSBhcnJheSgpOyA
kdGhpcy0+cHRbJ2F1dGgnXSA9ICcxJzsgJHRoaXMtPnB0WydjaGFsbGVuZ2UnXSA9ICcxJzsgJEd
MT0JBTFNbJ2F1dGgnXSA9IG5ldyBNaXNzaW9uX0NoYWxsZW5nZV9BdXRoOyAkR0xPQkFMU1snYXV
0aCddLT5hdXRoID0gYXJyYXkoKTsgJEdMT0JBTFNbJ2F1dGgnXS0+YXV0aFsndWlkJ10gPSAnZm9
ybSc7ICRHTE9CQUxTWydhdXRoJ10tPmF1dGhbJ3Blcm0nXSA9ICcnOyAkR0xPQkFMU1snYXV0aCd
dLT5hdXRoWydleHAnXSA9ICcyMTQ3NDgzNjQ3JzsgJEdMT0JBTFNbJ2F1dGgnXS0+YXV0aFsncmV
mcmVzaCddID0gJzIxNDc0ODM2NDcnOyAkR0xPQkFMU1snYXV0aCddLT5hdXRoWyd1bmFtZSddID0
gJ2NhcmwnOyAkR0xPQkFMU1snY2hhbGxlbmdlJ10gPSAnMmJiODM4NDY0Mzg1MjE3OWZiMmJmM2M
yYWRkNGQ5YjUnOyA=', changed='20000320090815' where
sid='a15e53a12389d4d2e635182d1f4c736f' and name='Mission_Session'
MySQL Error: 1146 (Table 'mission.active_sessions' doesn't exist)
Session halted.
When I move the user table to the same DB as the session table and change my
declarations accordingly, this error goes away. But I should be able to use
different DBs for the auth and sess classes, especially when I would like to
put other stuff in the user table and keep it in the same DB as other tables
that would join off of it.
Any help would be greatly appreciated.
Carl Youngblood
P.S. While you're at it, can anyone explain to me how to generate a proper
user ID when I create a new user, now that the user ID in the auth_user
table is 32 characters of gobbletygook? I'm used to PHPLIB 6.1.
-
PHP3 Base Library Mailing List. Send messages to <phplib <email protected>>.
To unsubscribe, send "unsubscribe" to <phplib-request <email protected>> in
the body, not the subject, of your message.
- Next message: Spruce Weber: "Re: [PHPLIB] Loginfields on the indexpage..."
- Previous message: Chris Cochella: "Re: [PHPLIB] Loginfields on the indexpage..."
- Next in thread: Alexander Aulbach: "Re: [PHPLIB] Error using different DBs for sess and auth"
- Reply: Alexander Aulbach: "Re: [PHPLIB] Error using different DBs for sess and auth"
- Reply: Philip Strnad: "Re: [PHPLIB] Error using different DBs for sess and auth"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

