RTC Forums
April 28, 2024, 11:26:01 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Sessions with JavaScript client (XML RPC)  (Read 4480 times)
brian71us
RTC Expired
*
Posts: 15


« 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
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 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.

For more information about RTC Sessions, check these topics:
Sessions and User Management
Web example using Sessions, Cookies and Form Post data (user input)

Best Regards,
Danijel Tkalcec
Logged
Dany
RTC License++
*****
Posts: 69


« Reply #2 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
Logged
brian71us
RTC Expired
*
Posts: 15


« Reply #3 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.
Logged
Dany
RTC License++
*****
Posts: 69


« Reply #4 on: February 05, 2017, 02:54:12 PM »

Aha, i see. Thank you for the info.

Regards,

/Dany
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.024 seconds with 16 queries.