ipad user agent changes during use?
In the logs of our website, we are occasionally seeing the user agent of an iPad 'switch' from one set of requests to the next.
On one set of requests that occur simultaneously, the user agent will look like this (which is the style of user agent we开发者_如何转开发 see most of the time for iPads):
mozilla/5.0+(ipad;+u;+cpu+os+4_2_1+like+mac+os+x;+en-us)+applewebkit/533.17.9+(khtml,+like+gecko)+version/5.0.2+mobile/8c148+safari/6533.18.5
The user then clicks a link or a button; the next series of requests will have a user agent setting like:
mozilla/5.0+(ipad;+u;+cpu+os+4_2_1+like+mac+os+x;+en-us)+applewebkit/533.17.9+(khtml,+like+gecko)+mobile/8c148
Notice how safari & the version fields are missing from the second. We are trying to understand what action or functionality on the iPad would cause this switch to take place, so we can replicate it in our test environment.
Posting all my findings related to this: Looks like the difference is in-fact between web-app mode and safari mode. You'll get the short user agent in web-app mode (and have no browser bar), the long user agent in safari mode. There are two ways to get into web app mode:
- Create a web clip and check the 'Full Screen' checkbox
- Add a meta tag to your website
<meta name="apple-mobile-web-app-capable" content="yes">
As for why we see both user agents from the same user? When you enter a site in web app mode, clicking on a link will swap the web app and re-open the page in Safari. This will also have cause the cookies to clear, possibly playing foul with your authentication scheme.
精彩评论