Users getting connected to a different session
Posted 23 May 2006 - 09:57 PM
The session process that I am using is simple:
and my connections to the database are though:
@ $db = mysql_pconnect(host, user, password);
Many of my databases have the same table names, so that a user may see data that should be seen only by another.
I am not terminating my pconnect or database queries -- and it seems that the termination of the scripts should all end them cleanly, right? Is there anything that I need to be doing with my $_SESSION that would cause it to work incorrectly? The SESSION stuff has seems to work well, but it pretty much magic to me. Should I store the session values in local cookies rather then on the server (at least, that is where I think that I am storing them)? Do I have to worry about how the server points one session file to another? Is there something that I need to think about regarding the naming of session?
Thanks for your help.
Posted 24 May 2006 - 04:29 AM
What was happening was my session was timing out, and the $_SESSION['dbname'] was not set. If you call a pconnect without selecting a database, it will grab a database randomly (that is, it probably uses a connection that is pre-connected to a database). I have built a test case that proved my hypothesis.
So, how to fix? I can either test the $_SESSION['dbname'] or probably a connect (not pconnect) would work. I think that I am going to go with the first -- but do you know the difference of connect vs. pconnect?
Posted 24 May 2006 - 05:01 AM
My bigest question however is.... Why do your users require individual databases?
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users