Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

1 Answer 1

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
1  
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
1  
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="ru.php.net/manual/en/…; –  kolypto Jan 15 '11 at 14:33

Your Answer

 
discard

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.