Re: How "xmlrpc_client" use session_id
Gaetano Giunta <giunta.gaetano <at> gmail.com>
2011-10-28 16:41:28 GMT
ha lzzy <lzzy.ha2011 <at> gmail.com> wrote on 26/10/2011 11:16:
> Xmlrpc Server: PHP Zend Server.
> Xmlrpc Client: C++.
> I want save my auth info use Session in php,just like
> $_Session["login"]="ok". but if xmlrpc_client request server again,I can't
> get $_Session["login"] value.
> What should I do
Use an xmlrpc client that supports session cookies.
Not all clients support sessions cookies, and not all of those who do do it automatically, you might have to
set some config in the client.
If the client does not support session cookies, on the 2nd call you will not find his session on the server any more.
If you can not change the client, you need to manage authentication in some other way:
- have the auth credentials sent in every request, do not use sessions
- have the client call a 1st service to authenticate, send him back a session token in the xmlrpc answer. In
all other calls, require the client to send the
token along with the request and validate it