RTC Forums

Subscription => Support => Topic started by: brian71us on February 02, 2017, 02:58:39 PM



Title: Sessions with JavaScript client (XML RPC)
Post by: brian71us on February 02, 2017, 02:58:39 PM
Hello,

I'm building an XML RPC server for processing requests from a JavaScript client and everything is working properly at the moment. What I would like to do is to implement a log in procedure on the web page and have the user id saved into a session. When the client executes a remote procedure call I would like to be able to reference the user id stored in the session to filter results returned by the server.

The project has a TRtcHttpServer, TRtcServerModule, TRtcFunctionGroup, and multiple TRtcFunction objects.

What would be the best approach?
How do I get the session id from within the TRtcFunction's OnExecute event handler?

Thank you


Title: Re: Sessions with JavaScript client (XML RPC)
Post by: D.Tkalcec (RTC) on February 02, 2017, 03:30:19 PM
Check the topic about "Using Sessions in Remote Functions",
which can be found in the FAQ topic "RTC Remote Functions - Explained"
(part of the RTC SDK Quick Start guide) - HERE (https://rtcforum.teppi.net/index.php?topic=311.0).

For more information about RTC Sessions, check these topics:
Sessions and User Management (http://realthinclient.com/sdkarchive/indexeadceadc.html)
Web example using Sessions, Cookies and Form Post data (user input) (http://realthinclient.com/sdkarchive/index2d622d62.html)

Best Regards,
Danijel Tkalcec


Title: Re: Sessions with JavaScript client (XML RPC)
Post by: Dany on February 05, 2017, 10:19:54 AM
I might be superstupid, but may i ask what is used in the client to call and interpret RPC XML on the client? Plain JS?

Regards,

/Dany


Title: Re: Sessions with JavaScript client (XML RPC)
Post by: brian71us on February 05, 2017, 11:33:17 AM

This is what I'm working with:

http://plugins.jquery.com/xmlrpc/
http://jquery-xml-rpc.readthedocs.io/en/latest/

There are also versions designed to work specifically with angular but I'm not using angular.


Title: Re: Sessions with JavaScript client (XML RPC)
Post by: Dany on February 05, 2017, 02:54:12 PM
Aha, i see. Thank you for the info.

Regards,

/Dany