Re: Sessions and redundant servers
| From: | lists at tech dot intelinet dot ro | Date: | Thu, 05 Jul 2001 20:17:57 +0000 |
| Subject: | Re: Sessions and redundant servers | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56379@lists.php.net to get a copy of this message | ||
On Fri, 6 Jul 2001, Daniel Baldoni wrote:
> G'day folks,
>
> Here's a theoretical question for those of you using PHP's inbuilt session
> facilities...
>
> How do you "keep" your variables across redundant servers? Or,
> isn't anybody out there hosting PHP-based services on grouped
> servers?
You are right, by default PHP stores session data in /tmp, but there are
ways to change this. First of all, rsync seems to be the least reliable
method, nfs seems better (i would not try it though). I have seen
session-handling implemented with postgresql (and i think porting it on
mysql isn't that hard...). You may want to take a look at
http://www.php.net/manual/en/ref.session.php
Also see http://freshmeat.net/search/?q=php+session,
there are a few
implementations of db storage for sessions.
Needless to say, having sessions stored on a database makes them available
across a cluster.
georgeb