Persistent session and using callback URLs

  • Jennifer Häfner
        Has successfully completed the online course Intermediate (200)
        Has successfully completed the online course Advanced (300)
        Has successfully completed the online course Basics (100)
        Has successfully completed the online course Advanced (310)
        Has successfully completed the online course Advanced (320)
        Has successfully completed the Intermediate Certification
        Has successfully completed the Advanced Certification
      2 years ago #35095
      Up
      0
      Down
      ::

      Hi Radostin,

      There is no automatic way of saving a session in Simplifier. But you can implement it using URL query parameters:

      • Before leaving the Simplifier app, store all relevant data in a database, add a key as identifier (can be an autogenerated session key)
      • When reopening the Simplifier app: append the session key to the URL as a query parameter
      • With the autofield ‘URL’ – ‘query parameter’, you can read the value of the URL query parameter
      • If the query parameter with the session key is not empty, navigate to the screen that you were showing when you left the app, and load the relevant data from the database with the session key
      • If the query parameter with the session key is not given or invalid, open the application in the usual way (starting with the login screen)

      You can find an example of using the query parameter autofield to control application logic in our Intermediate course, module 8, lesson 4: https://community.simplifier.io/207-4/

      Jennifer Häfner
          Has successfully completed the online course Intermediate (200)
          Has successfully completed the online course Advanced (300)
          Has successfully completed the online course Basics (100)
          Has successfully completed the online course Advanced (310)
          Has successfully completed the online course Advanced (320)
          Has successfully completed the Intermediate Certification
          Has successfully completed the Advanced Certification
        2 years ago #35096
        Up
        0
        Down
        ::

        Important note:

        When you are reopening the application again with the query parameter for the session key, you need to implement a user-login again because on reloading the app, the old login is lost.

        You have two options for that:

        • Let the user login once again manually
        • Perform the login automatically in the background.
          For this option, you have to store the previous user token in the database as well (retrieve it with the client-side business object ‘ITIZ_Utilities – GetUserToken’.
          Then, when loading the session data, you can trigger the login process with the following code snippet:
          this.Permission._setAjaxHeader(<the user token>);

         

        Let me know if you have any questions.

      Viewing 3 posts - 1 through 3 (of 3 total)

      You must be logged in to reply to this topic.