Jump to content

Archived

This topic is now archived and is closed to further replies.

william_rao

How to keep session data in multiple Apache servers?

Recommended Posts

We plan to install multiple Apache servers instead of single Apache server since it is overloaded. My concern is: in one user session, the user may send 2 or more requests. How do multiple Apache servers to communicate each other for the same session?

 

For example, we have Apache Server A and Apache Server B. A and B process user shopping cart requests in turn, but connect to the same database. User William wants to buy a PC and a notebook (just like in Dell.com). He login to the PHP shopping cart. First he puts a PC into his shopping cart, this request is processed by Apache Server A. Then, in same session, he puts a notebook into his shopping cart, this request is processed by Apache Server B. How can Apache Server B knows user William has a PC in shopping cart so B can calculate the total price for a PC plus a notebook?

 

Thanks a lot.

Share this post


Link to post
Share on other sites

The easiest way to make this work is just to use a common database between the two servers. Have all of your user session data stored here. Then either server can access the data at any time.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.