Login for mobile apps/session variables

Hi,

How do I create a login/session variables for mobile apps? I have did some searching on my own and it was recommended that I use local storage. However, this is not a true login system as data is stored on local devices rather than accounts. 

Hi Louie,

You are correct that the data is stored on the device and not in memory, mostly because of the amount of memory available on mobile devices. The local storage is a nice alternative and can be cleared when you logout for instance, which reduces the chance of sharing personal data.

If you want your settings to be shared over different devices, you should use synchronization with a server entity which can be accessed from all devices. 

Hopefully this answers you question/doubt.

Kind regards,

Remco Dekkinga

Hi Remco,

What I am trying to create is a user login system. I need each user to have his or her own set of data. Would it be possible to do that with a server sync? If so, how do I do so?

Regards,

Louie

Hi Louie,

Yes their is a possibility to do that with Offline Data Synchronization Patterns. Here each user can have separate data associated with it which is offline data store in local storage, once you finish your task then Sync your date to database server. 

Hi Louie,

We have login system for mobile app on our apps and basically it works this way:

 - to register user should be online and the process is similar to normal web app.

- on login action there is a synchronisation process to load all necessary data for this user so he can use app even without internet connection.

- on each data change there is a sync process that runs when user is online.

- on logout there is local storage clear script.

- there is a possibility to store user login/password credentials on encrypted local storage and allow user to re/login even if he is offline and logged out accidentally.

Hope this will help :)

Cheers,
Nick

Hi,

Use Android iOS Shared User Preferences Component on Forge.:

https://www.outsystems.com/forge/component-overview/5013/android-ios-shared-user-preferences

You can create a Key with name User_Session & set it's Boolean value based on Login & Log-out action. And then use it accordingly to validate throughout the App.

Note : The SharedPreferences will only be clear in two cases;

      - Either you manually clear 

     - App get's Un-Install from device


Cheers,

Assif


Hello 

There is no concept of Session in Mobile. So the notion of Session variables in the context of mobile does not exist. 

The way I see there are two parts to your question. 

1) Regarding Login 

To understand the concept of login in Mobile Authentication, go thru the below link.

https://success.outsystems.com/Documentation/11/Managing_the_Applications_Lifecycle/Secure_the_Applications/Configure_Mobile_App_Authentication


2) Session Variables 

   In general the below link talks on how to secure data on the mobile. 

https://success.outsystems.com/Documentation/10/Developing_an_Application/Secure_the_Application/Secure_the_Data_of_your_Mobile_Apps

You are right, you can use local storage , but this persists data across logins. One needs to explicitly clear it on logout. 

Also there a few plugins on Forge that use native features like Shared Preferences & NSUserDefaults to store key values pairs on Android & iOS respectively. 

One I developed Shared Preferences Plugin, if you would like to check this out. 

https://www.outsystems.com/forge/component-overview/4995/shared-preferences-plugin