Android Login with Token Session: like user logins and stays in session until logout

后端 未结 1 565
生来不讨喜
生来不讨喜 2021-02-06 17:45

After login in android app, how do I create a token session in the php api?

Like this:

I would like to make sure that when user log in it will stay in session no

相关标签:
1条回答
  • 2021-02-06 18:32
    • When your Android application first calls your Login API, retrieve the token fields from the validated response
    • Store these token fields locally, in the app, using SharedPreferences

    http://developer.android.com/reference/android/content/SharedPreferences.html

    • (this storage persists outside of the app/os lifecycle, it will still be there after a relaunch of the app or device reboot)
    • Whenever you call your web service (php), append the token parameters

    This looks like some relevant information here:

    http://www.androidhive.info/2012/08/android-session-management-using-shared-preferences/

    0 讨论(0)
提交回复
热议问题