Chandan Pasunoori
Chandan Pasunoori

Reputation: 959

How can I re-use a session cookie between terminations (Android)

I want to create a session on a server backend for Joomla PHP and a Javascript quiz module, that are used from an Android application.

Even if the Android application closes unexpectedly, that session should be available again on a subsequent load of the application.

What's the best way someone can suggest for this?

Upvotes: 0

Views: 130

Answers (2)

Amelia
Amelia

Reputation: 2970

I'd suggest storing the PHP Session cookies on disk if you are going to use $_SESSION in PHP. Otherwise, you should look into cookies that you can manually set the expiry time on and keep them stored on disk in Cache/

That will store the current progress of the application in the session cookie, but without a login (or code from you) there's not that much more i can say. To access from another browser/device you would need a login to identify the user and provide them with a valid session.

Upvotes: 1

Chris
Chris

Reputation: 5627

  1. Create a user account in your database for each phone, maybe identified by the phone's udid.
  2. Store the data in your database as the user moves through the quiz
  3. When the user opens the app, check their udid against your database and retrieve any data that is needed for that user

Upvotes: 0

Related Questions