[Solar-talk] Adapter-aware session package
Antti Holvikari
anttih at gmail.com
Sat Nov 10 14:18:57 CST 2007
On Nov 10, 2007 7:12 PM, Rodrigo Moraes <rodrigo.moraes at gmail.com> wrote:
> This solved an old mystery for me today:
>
> "Note that for security reasons the Debian and Ubuntu distributions of
> php do not call _gc to remove old sessions, but instead run
> /etc/cron.d/php*, which check the value of session.gc_maxlifetime in
> php.ini and delete the session files in /var/lib/php*." [1]
>
> I never thought that debian/ubuntu were cleaning up the session dir
> based on a cron job, and of course this explained why I never got
> persistent sessions working on local/online servers. It is very simple
> and perhaps obvious, but intrigued me for such a long time. :(
>
> So, now with session adapters I can override the debian/ubuntu
> behaviour and forget about the cron job cleaning up sessions, right?
> Do you recommend memcache to store, for example, user login sessions?
> Or...?
I did some simple benchmarking with the session adapters. It seemed
that using a userland session adapter was always slower than plain
normal PHP sessions. I believe this is because PHP needs to call those
user defined methods. Also, I don't know how using Solar_cache would
affect the performance in general.
Maybe I should write a "native" memcache adapter for the session, and
not use Solar_cache.
Using something like a db would allow you to query the table and see
the status of all the sessions. Any other ideas for a session adapter?
--
Antti Holvikari
More information about the Solar-talk
mailing list