Re: Can session.save_path data be saved to a database instead of a file system?
| From: | Caleb Walker | Date: | Wed, 02 Jun 2004 15:22:11 +0000 |
| Subject: | Re: Can session.save_path data be saved to a database instead of a file system? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-187456@lists.php.net to get a copy of this message | ||
On Wed, 02 Jun 2004 10:29:31 +0100, Michael Nolan wrote:
> Caleb Walker wrote:
>
>> I have 2 servers fail-over/load-balanced behind an F5
>> bigIP. I want session data to be maintained in the event one server takes
>> a dive. In this scenario, if a user is in the middle of doing
>> something while logged in, they will not have to lose all work and log
>> back into the server to continue working. Can that be done without
>> rewriting an application?
>> I saw a link here:
>>
>> http://www.phpfreaks.com/quickcode/DB_eSession_class_securely_stores_PHP_sessions_in_a_MySQL_DB/286.php
>> but this seems to be something that would have to be written into the
>> application and I didn't write it and do not want to take on the
>> responsibility to do so from here. Any thoughts would be much appreciated.
>>
>> Thank You,
>> Caleb
>>
>
>
> Yes, you can use a database to store session data and retain existing
> session manipulation methods. Surprisingly, the PHP manual tells you how:
>
>
> http://uk.php.net/manual/en/function.session-set-save-handler.php
>
> And lists a couple of examples, including this one at Zend:
>
> http://www.zend.com/zend/spotlight/code-gallery-wade8.php
>
> Mike
This looks like modifications that need to be made to the application. I
dont really want to touch the application. Instead I just want PHP,
through the php.ini file or whatever to take the session data and put it
in a database instead of the file system. In doing it this way, I assume
that I will not have to touch somebody else's code.
Thanks for the response.