The Project i am working on is based on multiple server which uses load balancer. The Problem is i can not maintain PHP session through out all servers.What is the best way to manage session over Load Balancer ... ?
3 Answers
i can think of these two methods for this purpose.
- Use a clustered web application server where the session are available for all the servers
- Use IP level information to maintain affinity between a user and a server

- 1,131
- 1
- 11
- 26
-
Thanks muzammil, its helpful,.. I think we can also Share user’s session information in a database or a file system on application servers. – ayaz javed Jun 03 '16 at 11:44
Working SSL & Load Balancer, it is common to put the SSL on the load balancing server, but not on the back end servers. So you only need one certificate on one server. The load balancer then talks to the back end servers using plain HTTP. This obviously requires that your back end servers are not directly accessible from the internet.This load balancer is responsible for decrypting the request, it will also be able to inspect the request for a jsessionid.

- 319
- 1
- 7
-
1What does SSL have to do with the question? How did this get 4 upvotes? – ceejayoz Jun 03 '16 at 12:10
-
1Sticky sessions work well with "Apache" as load balancer. You should check out the Apache "mod_proxy" and "mod_proxy_balancer" – Muhammad sohail Afzal Jun 03 '16 at 12:34
-
1
Dig the way to store session inside DB that maintains all of your multiple servers.
Servers always get the same _PHPSESSID
because of it's written as domain's cookie.
So if you know session ID — you know what to query from DB that serves sessions.

- 11
- 1