title: "apple-mobile-web-app-capable" site switches to Mobile Safari after logout
body: <p>When running a mobile site in iOS full screen mode, using the "apple-mobile-web-app-capable" meta tag, I am using a combination of AJAX and synchronous page requests, including redirects, with success while the user is logged in.</p>
  
  <p>However, when the user logs out and the session is destroyed, the iOS device leaves full screen mode and opens the login page in a Mobile Safari window. </p>
  
  <p>Here is a common sequence of events:</p>
  
  <ol>
  <li>User clicks button on Home Screen to launch mobile site in iOS full
  screen mode</li>
  <li>Server redirects user to login page for authentication (still in full screen)</li>
  <li>User logs in, and is redirected back to mobile home (still in full screen)</li>
  <li>User performs various actions, via GET and POST, some using AJAX and some not (still in full screen)</li>
  <li>User hits logout button, which destroys session and redirects back to login page</li>
  <li>Mobile Safari window opens to render login page this second time</li>
  </ol>
  
  <p>I have tried 301, 302 and 303 redirects on logout success and nothing seems to change this behavior.  It seems related to the user's session ending when running in full screen mode. I don't think this matters, but the security mechanism is implemented via Spring Security running on Tomcat.</p>
  
  <p>Is there any way to prevent this behavior? I would prefer not to use a location.href client side redirect on logout.</p>