Cross Sever Session maintain

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
prakashadmane
Forum Commoner
Posts: 33
Joined: Thu Mar 01, 2007 1:53 am
Location: mumbai,india
Contact:

Cross Sever Session maintain

Post 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
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post by superdezign »

You don't have access to another site's sessions.
prakashadmane
Forum Commoner
Posts: 33
Joined: Thu Mar 01, 2007 1:53 am
Location: mumbai,india
Contact:

Post by prakashadmane »

but how gmail and orkut maintain there session .
User avatar
Gente
Forum Contributor
Posts: 252
Joined: Wed Jun 13, 2007 9:43 am
Location: Ukraine, Kharkov
Contact:

Post by Gente »

I logged to google and not logged to orkut.
On orkut.com I just see login form with my login.
Pozor
Forum Commoner
Posts: 74
Joined: Tue Mar 30, 2004 11:11 pm
Location: Switzerland

Post by Pozor »

Hi,

two easy ways:
use sharedance or put your sessions in a db...
prakashadmane
Forum Commoner
Posts: 33
Joined: Thu Mar 01, 2007 1:53 am
Location: mumbai,india
Contact:

Post 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?
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.
prakashadmane
Forum Commoner
Posts: 33
Joined: Thu Mar 01, 2007 1:53 am
Location: mumbai,india
Contact:

Post by prakashadmane »

when i am trying to send session from one server to another .that particular session cant get me on another server.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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."
prakashadmane
Forum Commoner
Posts: 33
Joined: Thu Mar 01, 2007 1:53 am
Location: mumbai,india
Contact:

Post by prakashadmane »

when i goes to another server new session is created.so how will i check db.
User avatar
superdezign
DevNet Master
Posts: 4135
Joined: Sat Jan 20, 2007 11:06 pm

Post 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.
Post Reply