user1165952
user1165952

Reputation: 255

php application on two hosts

I have my php-mysql-oracle application hosted on two linux machines. Of late, I've been seeing some issues with my application intermittently. The $_SESSION variables are sometime populated, sometimes blank. My code also behaves weird. Sometimes a function works and sometimes it doesn't. I'm not able to replicate the issue correctly.

My assumption is $_SESSION and $_POST are getting mixed up somehow between the session. Is it really possible for such thing to happen. I dont have session and post variables saved in database.

Upvotes: 0

Views: 55

Answers (1)

jessepinho
jessepinho

Reputation: 5772

Are you running on a load balancer? If so, $_SESSION data is being saved to disk on one of the machines on the load balancer. Then, when the load balancer switches you to the other machine, the $_SESSION data no longer exists, since the session file on disk doesn't exist on that machine.

Upvotes: 3

Related Questions