How to Get the logged-In Username

Home Forums Convertigo developers Forums as moved to Stack Overflow. How to Get the logged-In Username

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #134305

    RItesh K

    Hi All

    Currently i am using the example “Room Search” project for learning. There we have login form.
    I am able to replicate that with my learning project.

    I am building a page called “My Accounts”
    under this section i want to display the logged in user’s username.

    How can i retrieve the current session user’s username by using C80 API?



    Gregory Vorbe

    Hello Ritesh,

    In the sampleMobileSearchRoom project we use the HTML5 localStorage object to locally store on device the username and password in clear text.
    You could use some jQuery in custom.js to set the user’s name when showing your “My Accounts” page:


    Or, you could use the Set Autenticated user step in your login sequence and the Get Authenticated user in the beginning all of your other sequences.
    This way you could check that the user’s session is still alive in the server (default HTTP session timeout is 300s per project) and make an XML output of the user’s name to retrieve it with CTF in your html pages.




    Hi ,

    Can you please give me some idea on Set Authenticated user and Get Authenticated user and how the data could be fetched from this step.



    Gregory Vorbe


    I have made a very simple sample mobile project for you to see how to use the Set/GetAuthenticatedUser Step.
    There are four sequences: login, checkAuthenticatedUser, next and logout.

    _ Use ‘login’ with c8o/test credentials to save the user name in the user HTTP session.
    _ ‘next’ sequence first calls ‘checkAuthenticatedUser’ to check if user session is still alive. You can then take decision according to the response.
    _ You can use the ‘logout’ sequence to simulate a session timeout (Use Remove authenticated user Step) and the execute ‘next’ sequence to see difference.

    You can test it directly executing sequences in Studio but it will be more relevant to launch the simple web UI I made via a browser :

    In the project Explorer View of Convertigo Studio, have a look at app.html and custom.js files to see CTF workflow.

    Get the project here


    • This reply was modified 5 years, 6 months ago by Gregory Vorbe.
Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.