Browser redirect back issue on IOS - ios

I have a website written on Symfony2. It works fine, but on IPhones > 4 and IPads > 2 it behaves strangely.
When I try to go to login page, it firstly loading login page and then redirects back to main page after a few seconds. On desktop and other devices it works good.
Can anyone help me?

Related

IPhone browser keep Error on specific website

I have a website for people to post photo and apply lipstick to that photo. Everything works perfectly at desktop and android. but when using iphone 6 to test, after I post the photo, it will display error on iphone browsers(both Safari and chrome). if I refreshed that page, the result will come out. Any idea about this weird behaviour? What can cause iphone browsers to fail displaying a webpage?
(I've tried all solution i found, like turn javascript off and on, turn off speech and reset datetime)
Safari(A Problem Occurred with this Webpage so it was Reloaded, after reload the result is shown). Chrome(Aw Snap!)
Usually that error (at least in Safari) happens when the webpage takes a long time to load.
Chrome offers this solution for its browser.

Permanently Redirect iOS Home Screen Web Apps

I have a single-page web app using Sencha Touch that has been added to the home screen on about 2000 iPads. I am looking to change the URL of the web app without requiring all of those users to delete the launch icon from the home screen, go to the new URL, and add it to home screen again. The app also uses a cache manifest to cache the HTML, CSS, JavaScript, and images, and the app is capable of working entirely offline.
Web pages added to home screen in iOS do seem to respond to HTTP 301 (permanent redirect) as expected, but I have found the behavior to be quirky in iOS 8 on iPad 2 devices as I will describe. I created an ASP.NET MVC website that I deploy under the same URL, replacing the Sencha Touch app in order to accomplish the permanent redirect. Here is the process I'm using and the behaviors I'm seeing:
When the app is launched from the old URL, it requests only the cache.manifest, and I return HTTP 404 to make the app stop caching.
The app loads and I have an event handler in the app's JavaScript for the applicationCache "obsolete" event that will call window.location.reload(true). The app will then reload and this time will ask for the previously cached HTML page (which is hosted at the URL root), and my ASP.NET MVC site will then return HTTP 301 to permanently redirect to the new URL.
Once the app hits the new URL, it begins downloading the resources from the cache.manifest at the new URL. I have an event handler on the "updateready" applicationCache event that will call window.location.reload(true) and reload the app. Once the app reloads, it will then request all resources (XHR requests to services) from the new URL as expected.
When I test this on an iPad 1 running iOS 5, this works exactly as I would expect. Once the resources from the new URL are downloaded and cached, it always makes every request from the new URL from that point. I can put the device in airplane mode and the app will work just fine offline.
This is where the quirky behavior begins, and I only see this on my iPads that are running iOS 8.x (I don't have any devices running iOS 6 or 7). I then close the app by pressing the home button and relaunch it from the home screen icon. When I relaunch the app, it will always initially go back to the old URL (iOS 5 always goes to the new URL), which is strange because the HTTP 301 from before should have prevented this. From here, there are two possible behaviors:
5a. Sometimes, it will ask for only the HTML page from the old URL (root URL), and in that case, it will get another HTTP 301 and will then redirect to the new URL, ask for the cache manifest, then load the app. From there and onward, it will never make requests to the old URL again when I open and close the app. When I put the device in airplane mode, the app works just fine offline. I have two iPad 2s running iOS 8.3 and 8.4, and this will happen about 50% of the time on these devices.
5b. Other times, it doesn't work so well. When relaunching the app after downloading the cached resources from the new URL, it will go back to the old URL and will not request the HTML page, and will instead request the cache.manifest along with the CSS and JavaScript. The the cache.manifest request will be result in another HTTP 404, but if I continue closing and re-opening the app, it will never consider the cache to be obsolete and will not request the HTML page again. Interestingly, I am only able to reproduce this on the iPad 2s. I have an iPad Air 1 running iOS 8.3 and I only ever see 5a on that device.
For the case described in 5b, it does request the JavaScript files. So, I went into one the JavaScript files and put in window.location.reload(true), which causes it to request the HTML page, which results in another HTTP 301. Now when this scenario occurs, it does send it to the new URL, but every time I close and re-open the app, it repeats the whole cycle. It goes to the old URL, gets the JavaScript, reloads, gets a 301, then goes to the new URL. When I put the device in airplane mode and open the app, it doesn't work.
I found that if I put the iPad 2s in airplane mode and run the app in the old URL, then run it again and do the 404 for the cache.manifest and the 301 for the HTML, then 5a will always occur. This sounds like a bug in iOS 8 (that possibly also exists in 6 and 7), and I'm trying to figure out a workaround that I can implement in my ASP.NET MVC website to redirect to the new URL that will work 100% of the time.
Any insights would be greatly appreciated.
I figured out how to avoid the quirky behavior. As I mentioned above, the app is listening to the "obsolete" event on applicationCache and is then calling window.location.reload(true) to grab the page again and get the 301. I found that if instead of reloading the same page, I redirect to a different page and back again, it works perfectly 100% of the time. It redirects to the new URL, caches the resources, then never asks for the old URL again. I also discovered that closing the app and opening it again after the cache is obsoleted has the same effect.

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.
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.

BlackBerry BrowserField Issue

My BlackBerry app uses BrowserField to display web pages. I have implemented the eventOccurred() method for the RenderingApplication. The first page loads fine. EVENT_BROWSER_CONTENT_CHANGED is fired after the URL is requested (EVENT_URL_REQUESTED) and the first page loads fine.
A button on the first page redirects to a different page. This works on a regular browser. On the simulator, the same page gets loaded again when the button is clicked. When I debug, I see that the EVENT_URL_REQUESTED is getting fired but the event.getURL() is same as the first page URL. I don't understand whats going on and if I am missing anything very obvious. Can anyone help please?

Rails redirect_to jQTouch site does not work as expected

I have a Rails app with a jQTouch mobile site that is displayed if the user goes to m.blah.com. First, I detect the browser, then to a redirect_to m.blah.com if it's an iphone, etc. All well and good. When I use desktop Safari, this all works exactly right.
However, when I use an actual iPhone or the Apple iPhone Simulator, it does not. The mobile site appears to load without the browser actually doing the redirect. The URL in the browser is still www.
I am wondering if this behavior is due to Mobile Safari, or if it is somehow jQTouch trying to load the page with AJAX, not a reload (which is odd as jQTouch hasn't been loaded at all before the redirect).
Any ideas?
We've experienced similar issues. Most of the time you can force the redirect by adding the :rel => "external" param to the redirect_to or Link_to call. Haven't quite sorted out exactly when this is required but it seems to resolve the majority of issues we have with dead links.

Resources