Search code examples
phpajaxweb-servicesnusoap

will webservice helps to Pass PHP Session one site to other site


Please any one tell me will webservice using nusoap helps to Pass PHP Session one site to other site. I need to pass the user session to my other site using PHP/Ajax/SOAP call


Solution

  • This is pretty easy with a callback (here we have server1 as origin, as server2 as server to redirect to):

    • From server1, redirect user to http://server2/auth_from_server1.php?id=12345
    • On server2 (internally, in the PHP code of auth_from_server1.php), do a request to http://server1/secret/check_session_id.php with the ID, 12345.
    • On server1, in the implementation of check_session_id.php, validate the ID and return OK, FAILURE, and session related data you want to pass, such as username, ...
    • On server2, when the call returns with OK, store the transferred session data, and give the user a cookie and session for this server.