Re: Custom Session usind MySQL

From: Date: Wed, 19 Nov 2003 01:13:24 +0000
Subject: Re: Custom Session usind MySQL
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-170215@lists.php.net to get a copy of this message
Manisha Sathe wrote:
I want the session to be accessed from different websites, so i got the answer in this forum only to make use of customised session with mysql. I searched the web and came to know that 'session.save_handler' of php.ini needs to be as 'user' but instead, on my server it is 'files'. As server is a shared server so i may not be able to change it, what can i do to resolve this ? Thanks in advance Manisha
You have to use session_set_save_handler() to register your session handling functions. One thing I would point out is that you need to lock the session storage, in this case one row in a table. As mysql cannot lock a row, only whole table, I would sugest you use GET_LOCK and RELEASE_LOCK mysql functions (with session id as the lock name) to implement session locking.

« previous php.general (#170215) next »