Re: [Phplib-users] Sessions in text files
Brought to you by:
nhruby,
richardarcher
From: Nathaniel P. <np...@te...> - 2004-12-03 16:14:48
|
Hristo Odiseev wrote: >Hi everybody, >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. > >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. >May be the smoothest way would be to wrap PHP's functionality using >PHPLIB's function so that such a conversion is less painful. > > This has been part of PHPlib for some time. Make sure you have the latest distribution of PHPlib and use prepend.php to include PHPlib instead of prepend.php3. The prepend.php file includes classes designed to work with PHP4 sessions (namely local4.inc, page4.inc, session4.inc, auth4.inc, and user4.inc). Their default configuration uses native PHP sessions, though it provides some hooks to make sessions work like PHPlib sessions, so you should have few problems porting an application over from one to another. Also, if you have customized your local.inc or prepend.php3, make sure you port those customizations over to local4.inc and prepend.php. Be aware, however, that you will lose any existing session data. (User data, if you use it, should be unaffected; it will still use the active_sessions table for that.) I'd point you to the relevant documentation, but the website appears to be down at the moment. -- ___________________________ Nathaniel Price http://www.tesserportal.net Webmaster |