Re: [PHP] Handling sessions between servers?
using mysql is an excelent choice, if your not using a db Ive seen people pass the data raw echo " mediawaveonline.com "; then session_decode(base64_decode($session_data)); its ugly, but it works. -- Chris Lee [EMAIL PROTECTED] "Josh Hoover" <[EMAIL PROTECTED]> wrote in message E973048AB322D411AE99009027E32DF685CD83@FRAZ">news:E973048AB322D411AE99009027E32DF685CD83@FRAZ... > You can use NFS shares, but I've read that it is too slow for most > situations. My suggestion would be to use a database and use a custom PHP > session handler. A really good tutorial (including working code) on how to > write custom PHP session handlers utilizing a database can be found at the > following URL: > > http://www.phpbuilder.com/columns/ying2602.php3 > > I've tested this code and it worked fine utilzing MySQL. You can apply the > same concepts to just about any datasource you want. > > Josh Hoover > KnowledgeStorm, Inc. > [EMAIL PROTECTED] > > Searching for a new IT solution for your company? Need to improve your > product marketing? > Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify > the process for you. > KnowledgeStorm - Your IT Search Starts Here > > > From: Michael Champagne [mailto:[EMAIL PROTECTED]] > > > > Is it possible to handle sessions with PHP between separate > > web servers? We > > have 2 Apache servers and would like to share session data > > between them. If > > we keep the session data on an NFS mounted drive -- will this > > work? Would it > > be better to write custom session handlers to store session > > data in a database > > accessible from both servers? It seems like this should be > > possible, but I'm > > not quite sure how to go about doing it. Also, this is on 2 separate > > platforms. One is RedHat Linux 7.1 and the other server is > > on AIX 4.3.3. > > > > Thanks in advance for any replies, > > Mike > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Handling sessions between servers?
NFS as a rule is a bad idea - there's a stateless protocol involved (you don't know if the server is up or down unless you actually try to write), the lockd for NFS incurs yet another set of communications, and it's not very robust for this kind of thing (no replication for failovers). A database is ideally suited for this kind of thing; if you have DB2 already running on AIX I'd suggest using it since you can replicate, failover, etc. should the need arise someday.Thne facilities to do this are tightly integrated into the product and they _do_ work - I set up and AIX/DB2/load balance/replication/HA solution at my last company using DB2 as the session handler for a BEA Weblogics server system. MySQL on the Linux box is a solution, also, but the replication strategy is a bit rough compared to other solutions and you'll have to make sure that you don't use table level locks by accident. PostgreSQL is of course yet another solution ... In any event you may want to check through the PHP archives for examples of database session handlers. - Original Message - From: "Michael Champagne" <[EMAIL PROTECTED]> To: "PHP General Mailing List" <[EMAIL PROTECTED]> Sent: Monday, September 17, 2001 10:49 AM Subject: [PHP] Handling sessions between servers? > Is it possible to handle sessions with PHP between separate web servers? We > have 2 Apache servers and would like to share session data between them. If > we keep the session data on an NFS mounted drive -- will this work? Would it > be better to write custom session handlers to store session data in a database > accessible from both servers? It seems like this should be possible, but I'm > not quite sure how to go about doing it. Also, this is on 2 separate > platforms. One is RedHat Linux 7.1 and the other server is on AIX 4.3.3. > > Thanks in advance for any replies, > Mike > > > > ** > This communication is for informational purposes only. It is not > intended as an offer or solicitation for the purchase or sale of > any financial instrument or as an official confirmation of any > transaction, unless specifically agreed otherwise. All market > prices, data and other information are not warranted as to > completeness or accuracy and are subject to change without > notice. Any comments or statements made herein do not > necessarily reflect the views or opinions of Capital Institutional > Services, Inc. Capital Institutional Services, Inc. accepts no > liability for any errors or omissions arising as a result of > transmission. Use of this communication by other than intended > recipients is prohibited. > ** > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Handling sessions between servers?
You can use NFS shares, but I've read that it is too slow for most situations. My suggestion would be to use a database and use a custom PHP session handler. A really good tutorial (including working code) on how to write custom PHP session handlers utilizing a database can be found at the following URL: http://www.phpbuilder.com/columns/ying2602.php3 I've tested this code and it worked fine utilzing MySQL. You can apply the same concepts to just about any datasource you want. Josh Hoover KnowledgeStorm, Inc. [EMAIL PROTECTED] Searching for a new IT solution for your company? Need to improve your product marketing? Visit KnowledgeStorm at www.knowledgestorm.com to learn how we can simplify the process for you. KnowledgeStorm - Your IT Search Starts Here > From: Michael Champagne [mailto:[EMAIL PROTECTED]] > > Is it possible to handle sessions with PHP between separate > web servers? We > have 2 Apache servers and would like to share session data > between them. If > we keep the session data on an NFS mounted drive -- will this > work? Would it > be better to write custom session handlers to store session > data in a database > accessible from both servers? It seems like this should be > possible, but I'm > not quite sure how to go about doing it. Also, this is on 2 separate > platforms. One is RedHat Linux 7.1 and the other server is > on AIX 4.3.3. > > Thanks in advance for any replies, > Mike
[PHP] Handling sessions between servers?
Is it possible to handle sessions with PHP between separate web servers? We have 2 Apache servers and would like to share session data between them. If we keep the session data on an NFS mounted drive -- will this work? Would it be better to write custom session handlers to store session data in a database accessible from both servers? It seems like this should be possible, but I'm not quite sure how to go about doing it. Also, this is on 2 separate platforms. One is RedHat Linux 7.1 and the other server is on AIX 4.3.3. Thanks in advance for any replies, Mike ** This communication is for informational purposes only. It is not intended as an offer or solicitation for the purchase or sale of any financial instrument or as an official confirmation of any transaction, unless specifically agreed otherwise. All market prices, data and other information are not warranted as to completeness or accuracy and are subject to change without notice. Any comments or statements made herein do not necessarily reflect the views or opinions of Capital Institutional Services, Inc. Capital Institutional Services, Inc. accepts no liability for any errors or omissions arising as a result of transmission. Use of this communication by other than intended recipients is prohibited. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]