void Posted May 10, 2008 Share Posted May 10, 2008 Hi everyone, I'll keep it short - i have two servers with different IPs for one site. The main has the www.domain.com address and another ones has remote.domain.com (both A-records). If a session is being created in the main site, it expires on another server, even though i have ".domain.com" set in my php configuration (cookie_domain). Is it possible to synchronize (?) the sessions on both servers? I wouldn't like to transfer sessids on url. Thanks in advance. Link to comment https://forums.phpfreaks.com/topic/105020-session-expires-in-remote-server/ Share on other sites More sharing options...
PFMaBiSmAd Posted May 10, 2008 Share Posted May 10, 2008 It is likely that the session cookie is being sent, have you checked by echoing it? Assuming that the session cookie is being sent, your real problem is that a session only exists on any server because a session data file gets created that is tied to the session id. The session data file will be created on the server where the session is first established. To get the session data file to be available to the second server, you would either need to store the session data files in a shared location, in a shared database, or actively write it to both servers every time it gets updated on either server. Link to comment https://forums.phpfreaks.com/topic/105020-session-expires-in-remote-server/#findComment-537601 Share on other sites More sharing options...
void Posted May 10, 2008 Author Share Posted May 10, 2008 Yea, so I need a solution for a shared session file. What would you guys suggest? Of course, sessions for completely other applications on the secondary server should not be disturbed. Maybe it's possible to have several session data files? Link to comment https://forums.phpfreaks.com/topic/105020-session-expires-in-remote-server/#findComment-537815 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.