|
|
anyone gotten adodb db sessions going?
|
|
|
|
Fresh-Faced Recruit
Join Date: Oct 2005
Status:
Offline
|
|
I have setup adodb sessions on a php4 host and a php5 host to share the same db. The db connection is all done with adodb and works fine. The sessions are created, but they do not follow the user between hosts as intended. They are getting separate session ids. I am wondering if this has to do with the way the globals are used in the session code? I had to define several variables as global and then set them on the php5 system in order for the code to work out.
So far I have assigned the code below. Is there anything else I might be missing causing these sessions to not work with PHP5?
[ I define these before requiring the adodb-session file and then after including the file I run session_start()]
global $ADODB_SESSION_DRIVER;
$ADODB_SESSION_DRIVER = 'mysql';
global $ADODB_SESSION_CONNECT;
$ADODB_SESSION_CONNECT = dbserver;
global $ADODB_SESSION_USER;
$ADODB_SESSION_USER = dbuser;
global $ADODB_SESSION_PWD;
$ADODB_SESSION_PWD = dbpassword;
global $ADODB_SESSION_DB;
$ADODB_SESSION_DB = dbname;
global $ADODB_SESSION_TBL;
$ADODB_SESSION_TBL = sessions
global $ADODB_SESSION_EXPIRE_NOTIFY;
$ADODB_SESSION_EXPIRE_NOTIFY = null;
Thanks for the help.
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Oct 2005
Status:
Offline
|
|
Ok, I made some progress. I found that because the two servers have different urls I should set the cookie domain to the domain and that way they can be different subdomains ok.
That seems to be working. I now only get one session with the same session ID. The trouble I am having now is that with the adodb sessions I cannot retrieve the data from the previous server. It's in the db, and I can see it. I just get an empty array.
Any ideas as to what else I might be missing?
Thanks
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Jul 2004
Status:
Offline
|
|
if the second domain is on another server than the first you need to setup mysql to allow the second server to connect to its mysql database
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Oct 2005
Status:
Offline
|
|
That all works. They both read data from the same db. Before I set the cookie domain in the php.ini on both servers both servers would set sessions with separate session ids in the same db table. So I'm sure the db part is working.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|