0

I am new to Phonegap, but currently starting up a project that involves a simple HTML based app. I do not expect many problems implementing it as it is a simple project. One thing bothers me however.

Before users can login to the application they need to do a two factor authentication by entering a password and an OTP token. When succesfully authenticated the user will have a JSESSIONID cookie during it's session.

My first question is: will the session be automatically maintained while the user is using the phonegap application?

My second question is: is it possible to maintain the session also during application stop and start within a certain timeframe? For example I would like it if the user logs in to the application, then starts up another application and then returns to my application within the timeframe without having to re-authenticate.

Many thanks in advance

Tim

Tareq Salah
  • 3,720
  • 4
  • 34
  • 48
timboektoe
  • 115
  • 1
  • 2
  • 13
  • To make the context of my quetions a bit more clear: What I don't understand is how the JSESSION_ID cookie is handled in a phonegap application. In a browser I know that it normally is available during the session i.e. it will be available as long as the user does not log out and I do not close the browser. How does this work in phonegap? – timboektoe Dec 26 '13 at 16:18

1 Answers1

0

Your first question, I don't think it's related to phonegap. As long as your phonegap keep sending the cookie to server within the timeout period, the session will be maintained.

Your second question, same as first answer, as long as the cookie is sent across to server within timeout period, that session will be maintained.

Wins
  • 3,420
  • 4
  • 36
  • 70
  • Yes I understand that, maybe I pose my question in the wrong way. What I don't understand is how the JSESSION_ID cookie is handled in a phonegap application. In a browser I know that it normally is available during the session i.e. it will be available as long as the user does not log out and I do not close the browser. How does this work in phonegap? – timboektoe Dec 26 '13 at 16:17
  • @user2715460 Think the phonegap as an application and not as browser. Although it is HTML, CSS and JS based, it is just as simple as a client to the server. Much like browser, browser doesn't maintain session, it is the server that maintain the session. – Wins Dec 27 '13 at 01:24
  • Yes that is true, but even when the server maintains the session the browser should have cookies enabled sothat the server can recognize the session. In the browser this is done automatically (as long I have cookies switched on) I wonder whether this automatic cookie handling is done for me out of the box when I use phonegap (just like in the browser) – timboektoe Dec 27 '13 at 10:31
  • this may help http://stackoverflow.com/questions/8449736/storing-and-sending-of-http-cookies-not-working-in-phonegap-app – Wins Dec 31 '13 at 10:57