1

I have 3 servers. One MySQL database and 2 Apache web servers with a load balancer. Www1 copies it's data to www2 every other minute and vice versa. The issue I'm having is that say a user goes to the site and hits the www1 server, attempts to login, the page refreshes and now they are on www2 and then not logged in. Then if you refresh the page and if you hit www1 you are logged on again. This happens for about 2 minutes until the servers match info and depending which one does first you might not be logged in anymore. I set up a simple php session login. Does anyone have experience with working on clustered systems and setting up logins. Any advice would help. Hank you for your time.

2 Answers 2

0

Since you already have a MySQL Database. Create database based PHP sessions. The session information can be passed via the url and auto clean after so many minutes of inactivity and the page is loaded requiring customer to relogin.

1
  • Thank you James, I will try this out. I did not know I can save sessions on the DB. Oct 24, 2011 at 15:28
0

I would suggest creating a memcache server and store your PHP sessions from both apache servers on the memcache server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.