TRtcClientModule and TRtcServerModule component have automated Session management built into them and is enabled automatically if you use Encryption, or if you enable it with the AutoSessions property. For Sessions to work, TRtcServerModule will create a Session object and send it back to the TRtcClientModule component, after which the TRtcClientModule component will be sending it in each request to the TRtcServerModule component. Even though TRtcClientModule and TRtcDataRequest components are using the same TRtcHttpClient component, they do not share the same Session handling mechanism.
When using the same TRtcHttpClient component for TRtcClientModule and TRtcDataRequest components, to access the same Session data from the TRtcDataProvider component on the Server, you need to send the Session ID manually to the Server in each request when posting the request to the Server with the TRtcDataRequest component, then lock that Session ID for usage (check
HaveSession and
FindSession methods on the TRtcDataServer component).
If you need an example on using HaveSession and FindSession methods,
HERE is a link to the related FAQ topic in the RTC archive. Since you want to use the Session created by the TRtcServerModule component, you will not be using the OpenSession method, but you will be sending the Session ID in the request from the Client and will be using the HaveSession method to check if a session exist and the FindSession method to lock the Session for usage (make Session data available through the Session property).
Best Regards,
Danijel Tkalcec