Web Hosting Talk







View Full Version : communication between two PHP applications


darmar
06-06-2007, 07:28 AM
I'm looking for articles on communications between two PHP applications on two diferent servers....

what I need the most is an ability to somehow share the session variables between them...

any link on this issue would be great !


thank you

sasha
06-06-2007, 11:00 AM
You can store session data in the database rather then in file and use then send session identifier in the URLs between servers. If you do decide to to this take a look at session_set_save_handler(). There is some security issues with this as you base access on something that is sent in URL, so you will want to add some additional verifications to the process to make sure your sessions cannot be hijacked.

Burhan
06-06-2007, 01:33 PM
In addition to what sasha said; if you just want to trigger an action on the other server based on some session variable, than you can use any number of RPC methods, like XML-RPC and SOAP; and pass the information in the XML envelope.

Of course, the security warning applies as well.

cyberlot
06-06-2007, 04:14 PM
There are also socket servers and other various methods..

It really depends on your specific needs.

darmar
06-06-2007, 05:55 PM
thanks for info, I'll "play" with those session identifiers and handlers that sasha mentioned, but the RPC sounds OK also....
thanks again