Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <hr> <p><strong>Update</strong>: Although my answer gets downvoted, I think this is the easiest way to dealing with the forced reloads by iOS. My strategy does <em>not</em> stop the web app from re-loading on opening, but it does give you an easy way to keep the session alive so that you can detect and restore the session from the server side, so that the app flow isn't broken (as requested by the OP).</p> <p>NB; this works easiest if all pages in your web app are always approached through the same URL (eg. <a href="http://webapp.yourdomain.com/index.php" rel="nofollow noreferrer">http://webapp.yourdomain.com/index.php</a>); if not you will need to store the user's location in the session data on the server side and forward the user to there when he enters your web app through the main URL.</p> <p>As said, this allows you to keep the state intact even between device reboots, so even though it doesn't technically stop the web app from being reloaded when launched from the home screen, it seems to me to be the easiest way to restore the state for the user without him/her noticing the reload.</p> <hr> <p>An easy solution is to extend the lifetime of your session cookie. This works across web apps (as long as they point to the same page, of course), and even between the web app and the regular web version of your application.</p> <p>No local storage solution is required because all logic remains server side, and this even works between device reboots. An HTML request is still done every time the web app is opened, but without breaking app flow because the server simply serves the same content as where the user was before he left the web app.</p> <p>The trick is to do this:</p> <pre><code>// Start or resume session session_start(); // Extend cookie life time by an amount of your liking $cookieLifetime = 365 * 24 * 60 * 60; // A year in seconds setcookie(session_name(),session_id(),time()+$cookieLifetime); </code></pre> <p>For a more elaborate discussion of this strategy you can take a look at my answer of this question: </p> <p><a href="https://stackoverflow.com/questions/9998900/maintain-php-session-in-web-app-on-iphone/14594908#14594908">Maintain PHP Session in web app on iPhone</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload