I’ve created a jQuery Mobile site with PHP which requires authentication and is so far working well. Users on iPhone/iPads are encouraged to save the website to the home screen as a web clip to give them direct access to the site without the safari toolbars etc.
On iOS devices when a user clicks the home button or gets a phone call and they return to the site they are logged out and have to login again. This doesn’t happen when they access the site directly from Safari.
Is there a way to have them remain logged for a period of time (e.g. 15 minutes) when they are accessing the site from a web clip on their home screen and get a phone call or click the home button?
In php.ini or via .htaccess, set session.cookie_lifetime to 900 to have it last 15 minutes. The default is 0, which lasts until the browser closes. Web clips seem to “close” every time you switch away from them, so you lose your cookie immediately. http://www.php.net/manual/en/session.configuration.php#ini.session.cookie-lifetime