Re: [Phplib-users] Sessions in text files
Brought to you by:
nhruby,
richardarcher
From: Layne W. <la...@dr...> - 2004-12-03 16:08:12
|
> I have trouble with phplib because it is writing its sessions in a > mysql DB. It happens quite often that my active_sessions table is > corrupted or inconsistent in some way. I would like to use PHP's > session mechanism and even prefer its default setting of writing > sessions in txt files somewhere. Did anyone make such a conversion and > if yes could you give me some hints. An example will be greatly > appreciated. A PHPLib-style wrapper for native PHP4 sessions has been in place for some time. There are actually two variations: session4.inc and session4_custom.inc. For documentation on using these classes, check <http://sanisoft.com/phplib/> (the server seems to be down at the moment). > As to the DB corruption, I can only say that my application is heavily > used and my session data is quite big sometimes. The active_session > table is usually 500+MB. With a heavily used application, you are most likely going to see a slowdow= n in using native PHP4 sessions due to the disk I/O. How often are you seeing a corrupted active_sessions table? (In the last 6 years, I've only seen a corrupted active_sessions table once.) You could set a cron job to check th= e table and repair it if there are problems, or if you have a short period of no activity (early Sunday morning almost always works for me) you could dro= p and rebuild the table daily or weekly. --=20 Layne Weathers |