Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I know that putting PHP sessions in a common DB is a good solution, but let's say I have to support apps using standards sessions saved in files. It is possible to share PHP session by a pool of n servers using something like GlusterFS? Is there any possibility of corruption of the session files?

share|improve this question
up vote 0 down vote accepted

Just ensure your platform supports entries locking (files — in case of GlusterFS), or at least — atomical write operations: this will ensure your session files are not corrupted.

In fact, you'd better use Memcached/Redis/... any other mem-storage.

share|improve this answer
That depends on how heavily you make use of sessions. If you only really write to them when a user logs in/out, you can safely skip over the locking entirely. – devicenull Jan 15 '11 at 4:15
I need something transparent. Is it possible to use memcache configured by default. Think about a hosting environment. – rtacconi Jan 15 '11 at 11:01
Actually I did not it was possible to configure session storage using memcache. It can be configured in php.ini – rtacconi Jan 15 '11 at 11:15
Even if you had no option for memcached — you could implement it using <a href="…; – kolypto Jan 15 '11 at 14:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.