blu.org  wiki

 « Return to Thread: PHP web clusters and session information

Re: PHP web clusters and session information

by Matt Shields-5 :: Rate this Message:

Reply to Author | View in Thread

On Wed, May 14, 2008 at 11:39 AM,  <markw@...> wrote:

> Are there any admins/architects that have multiple web servers using PHP
>  and are sharing sessions.
>
>  I have an open source project I've been trying to get going for a while
>  now and I'd like to solve the major issues for this type of deployment.
>
>  --
>  This message has been scanned for viruses and
>  dangerous content by MailScanner, and is
>  believed to be clean.
>

Yes, you have two options.  Either use file sessions and store the
sessions on one of the servers and mount that directory via nfs to the
other servers.  But I recommend against this.  Or re-write your code
to store the sessions in the database, that way no matter what
database you hit, you'll be pulling the session data from the db.

There are tons of PHP examples out there of how to write your own db
sessions using session_set_save_handler
http://us2.php.net/manual/en/function.session-set-save-handler.php  Or
what I did was to use PEAR::Http_Session2
http://pear.php.net/packages.php?catpid=11&catname=HTTP


--
-matt

--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

_______________________________________________
Discuss mailing list
Discuss@...
http://lists.blu.org/mailman/listinfo/discuss

 « Return to Thread: PHP web clusters and session information

LightInTheBox - Buy quality products at wholesale price