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?
Asked
Active
Viewed 1,385 times
1 Answers
0
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.

kolypto
- 11,058
- 12
- 54
- 66
-
1That 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 04: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
-
1Actually 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 session_set_save_handler() – kolypto Jan 15 '11 at 14:33