0
votes

I am using the SQL adapter for user login in mobilefirst server.

How can i store user login credentials permanently in my hybrid app?
Once the user exit the app need to keep the login details in app.

My example code:

// Global variables
    var userid;   
    var useremail; 


    function loginsuccess(result) // on success function from SQL adapter      
    {
    var user  = result.invocationResult.resultSet;     
    userid = user[0].playerID;     
    useremail = user[0].email;     
    $.mobile.changePage("#gamepage"); // login to admin page    
    }

In this code how can i keep the user information after exit from hybrid app.(Once the user login don't ask the user to login again).

1

1 Answers

0
votes

How can i store user login credentials permanently in my hybrid app?

If you want to persist the user information in the device, you need to implement that; there is nothing built-in to accomplish that.

You have several options:

1) HTML5 localStorage (a W3C standard, google it), but it has issues:

  • If the user will decide to clear the application cache, this will be gone
  • It will store the user information in clear text, not very secure
  • Limited to 5MB or so

2) IBM MobileFirst Platform's Encrypted Offline Cache, basically localStorage but provides encryption. But it too has some issues:

  • Deprecated (will be removed in future releases)
  • If the user will decide to clear the application cache, this will be gone
  • Limited to 5MB or so

3) IBM MobileFirst Platform's JSONStore - what you should probably pick:


It also sounds like you want to implement "Remember Me" functionality.
Note that such functionality reduces the application security...

Related questions for that: