[PHP] Re: Load Balancing and PHP Sessions
A better way to set this up might be to use a reverse proxy in front of www1.test.com and www2.test.com. Users would go to www.test.com and the reverse proxy would forward communications between the front-end and the servers in the back, thereby balancing the load. Cookies should still work fine, regardless of the server that actually sets them. (I'm not sure if PHP's built-in sessions would work...) Since I'm assuming you're using Apache here, you'd most likely want to look into using Squid, which is a kick-ass proxy. Setting up the re-director is a bit of a hastle, since you basically have to write one from scratch, but it isn't too difficult. (There are lots of pre-made ones that can handle things like round-robins, randomness, all that jazz.) J Baumann Reto wrote: Is it possible to have sessions (via cookie) on a load balanced environment? Therefore having www1.test.com and www2.test.com and share the same sessions? The systems can access the same file-system, but it seems that the session is not passed. Could this have something to do with session.cookie_domain? Thanks for any help Reto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] RE: Load Balancing and PHP Sessions
Or save it to a common database... and it could have something to do with session.cooke_domain. A cooke set explicity to www1.test.com won't be viewable on www2.test.com, but if you set the domain to .test.com it will... On Thu, 25 Apr 2002, Dan Harrington wrote: Couldn't you store the session information on disk using sessions.save on an NFS volume that is shared between machines? Dan -Original Message- From: Baumann Reto [mailto:[EMAIL PROTECTED]] Sent: Thursday, April 25, 2002 3:39 PM To: [EMAIL PROTECTED] Subject: Load Balancing and PHP Sessions Is it possible to have sessions (via cookie) on a load balanced environment? Therefore having www1.test.com and www2.test.com and share the same sessions? The systems can access the same file-system, but it seems that the session is not passed. Could this have something to do with session.cookie_domain? Thanks for any help Reto -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php