David Guerizec wrote:
> 1) Should I create two more tables (active_sessions & auth_user) in the
> Midgard database or should I create a separate database for each vhost I
> have ?

PHPLIB usually assumes that you store the PHPLIB tables with the
application tables. This is because PHP is severly broken in how
it handles database connects: PHP silently reuses database connections
if you connect parameters match preceding connect parameters. That is

$l = mysql_connect("a", "b", "c");
$m = mysql_connect("a", "b", "c");

will create a single shared database connection and not two distinct
connections as many will instinctively assume. This is particularly
nasty if you

$db  = new DB_Midgard;
$db2 = new DB_Application;

and both the Midgard and Application database are being connected
using the name host, user and password parameters. In this case you
will have two distinct objects, but both will share a single database
connection.

Sharing a database connection would be harmless, if this connection
had no state. As it is, MySQL database connections have a state, the
current database as selected with mysql_select_db. Other database
connections have state, too: The currently open transaction. So it
is in my eyes a design error to treat this as stateless and reuse 
and share it, but somehow the Powers That Be do not seem to understand
me.

The PHPLIB recommendation is to pack everything, PHPLIB tables, 
Application tables and Midgard tables, into a single database and
not switch database at all.


> 2) How to synchronize the user informations/authorization from
> Midgard/Apache and PHPLib ???

PHPLIB does not make any assumptions about the database table or
database structure used for authentication. If someone would
list how Midgard authentication data is being stored, I could
explain how to make PHPLIB use Midgard Auth tables.

> (And I really don't like URLs like
> http://www.mydomain.com/path/to/page?session_id=afc45e6d9b23f5a...)

Use cookies, disable fallback_mode. Or use mod_rewrite to fold
them into the URL.

Kristian

-- 
Kristian K�hntopp, NetUSE Kommunikationstechnologie GmbH
Siemenswall, D-24107 Kiel, Germany, +49 431 386 436 00
Using PHP3? See our web development library at
http://phplib.netuse.de/ (We have moved! Update your bookmarks!)

--
This is The Midgard Project's mailing list. For more information,
please visit the project's web site at http://www.midgard-project.org

To unsubscribe the list, send an empty email message to address
[EMAIL PROTECTED]

Reply via email to