iPad/iPhone : how to keep the session in a web app

ic3 picture ic3 · Feb 5, 2012 · Viewed 9.9k times · Source

It's straight forward to add a web page as a web application. Find here a nice article.

The issue know is keeping a session open. Once switching to another app the session is closed and the user needs to re-enter his credentials.

I've found a similar entry without answer in stack-overflow.

Some hints ?

Answer

adamdehaven picture adamdehaven · Mar 10, 2012

Instead of storing the login info in a $_SESSION variable, store it in a $_COOKIE. The cookie will be saved depending on when you set it to expire. As long as they log in "inside" the web app, or the regular web version (and the cookie is the same) they will not have to log in every time or when switching between the two.