Page 1 of 1

Cross Sever Session maintain

Posted: Wed Jun 20, 2007 2:53 am
by prakashadmane
Hi guy

i am developing site on that how to maintain the session between 2 server that server are located on diffrently. when i loging on one site then automatically login on another site. same like of gmail.com & orkut.com .please help me

Posted: Wed Jun 20, 2007 5:49 am
by superdezign
You don't have access to another site's sessions.

Posted: Wed Jun 20, 2007 6:00 am
by prakashadmane
but how gmail and orkut maintain there session .

Posted: Wed Jun 20, 2007 6:09 am
by Gente
I logged to google and not logged to orkut.
On orkut.com I just see login form with my login.

Posted: Wed Jun 20, 2007 6:21 am
by Pozor
Hi,

two easy ways:
use sharedance or put your sessions in a db...

Posted: Wed Jun 20, 2007 6:55 am
by prakashadmane
i have stored session in db .I am using 2bd one for storing user data and one db for blogs/forums/grous. both the db are on same server. but main application and blog/forum/ application is on different server. when user logs into main application i am storing session into user db as well as blog/forum db. now when user clicks on link in main application which redirects user to blog/forum application i am lossing session. i want to maintain session on these 2 applications. any ideas?

Posted: Wed Jun 20, 2007 7:36 am
by superdezign
If you store the sessions in a database, make sure both serves have access to the database. Then, send the session id from one server to the other so the second server knows which session to access.

Posted: Wed Jun 20, 2007 7:42 am
by prakashadmane
when i am trying to send session from one server to another .that particular session cant get me on another server.

Posted: Wed Jun 20, 2007 7:46 am
by superdezign
Did you read what I posted?

The sessions are in the database. Give both serves access to THAT session. There's no need to "send a session."

Posted: Wed Jun 20, 2007 8:05 am
by prakashadmane
when i goes to another server new session is created.so how will i check db.

Posted: Wed Jun 20, 2007 8:37 am
by superdezign
That's what I'm saying.. Don't create a new session. Send the session id from the first server to the second in the url ($_GET) and access the original session in the database using that id.