Stateful services based on HTTP cookies / Server side |
In your 4GL function declared as session initiator, you must:
Handle the creation of the session.
Fill the state variable before to return from the function.
Store the state variable in a database based on the state variable (in order to keep the session across consecutive requests from a same client).
FUNCTION GetInstance() # Generate an unique string (can come from a database table id) LET ServiceState = com.Util.CreateUUIDString() ... Store ServiceState value into database or use directly a database table entry to hold the session END FUNCTION