Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iPhone Safari bookmark creates new session

I have a strange problem with a website I've developed for one of our clients. What I'll do is bookmark the home page using the "add to homescreen" Safari menu item. I will then browse around for a while and then go back to the phone's home screen, e.g. if someone calls me or I'm checking mail or whatever it is iPhone users do. When I tap the bookmark on the homescreen, I will be taken to the login page. When I log in, I'm taken to the home page as normal, but if I try to navigate anywhere else, the link opens in a new browser instance. I know this because my bookmarked link opens a Safari session in full screen mode, but the new browsed link opens a Safari session with the address bar and other goodies visible. I then have to log in again, but this time everything works fine.

It's only when I use the bookmarked link that it does this weird login thing. THe site works perfectly well on desktops (Mac and PC) as well as Android and Windows Phone 7.x and 8.x devices.

like image 820
Captain Kenpachi Avatar asked Jun 22 '15 12:06

Captain Kenpachi


1 Answers

Right, so anyway, the problem was that another developer added the meta-tag <meta name="apple-mobile-web-app-capable" content="yes">. What that does is tell IOS that the webpage supports offline mode. Unfortunately, ours doesn't. I changed the tag to <meta name="apple-mobile-web-app-capable" content="no"> and all was well.

It's not a problem in our case because the meta tag was put there by mistake. We simply needed the meta tag for the nice homescreen icon and the above tag was also in the code snippet.

like image 163
Captain Kenpachi Avatar answered Oct 04 '22 04:10

Captain Kenpachi