Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To maintain Session over Load Balancer? [duplicate]

Tags:

php

webserver

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 ... ?

like image 458
ayaz javed Avatar asked Jun 03 '16 11:06

ayaz javed


2 Answers

i can think of these two methods for this purpose.

  1. Use a clustered web application server where the session are available for all the servers
  2. Use IP level information to maintain affinity between a user and a server
like image 91
Muzammil Naseer Avatar answered Oct 12 '22 15:10

Muzammil Naseer


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.

like image 25
Muhammad sohail Afzal Avatar answered Oct 12 '22 13:10

Muhammad sohail Afzal