I am working on migrating a IBM MobileFirst 6.3 project to version 7.1 and enabling the 7.1 session independent mode. I have specified the attribute store as the worklight default runtime database.
In the previous version I have used HTTPSession object in HTTP JavaScript adapters to dynamically store some minimal data related to the current user session as shown in the sample code below.
var request = WL.Server.getClientRequest();
var session = request.getSession();
session.setAttribute("ID", "123");
session.setAttribute("UserName", "xxx");
As I cannot use session object anymore, are there any WL.Server APIs available for explicitly store/retrieve/remove data from the default attribute store (WL run-time database)? Couldn't find any examples on this. Please advise. Thanks.
Knowledge center documents this scenario and solution for 7.1 Session Independent mode here
https://www.ibm.com/support/knowledgecenter/en/SSHS8R_7.1.0/com.ibm.worklight.dev.doc/devref/c_java_server_side_api.html#java_server_side_api__java_rest
Saving applicative state between requests in Java RESTful adapters
Sample also is attached in the link above.