Note that there are some explanatory texts on larger screens.

plurals
  1. POGet requests to Asp.Net MVC 3 app fail on Mobile Safari when launched from home screen shortcut
    primarykey
    data
    text
    <p>I have an Asp.Net MVC 3 mobile web app and get requests fail with HTTP 302 response in Mobile Safari when app is launched using short cut on home screen.</p> <p>I've nailed down root cause being in different user-agent strings sent to web server. For reference, below are three user-agent strings I use for testing:</p> <p><strong>Chrome</strong>:<br> Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.107 Safari/535.1 </p> <p><strong>Mobile Safari</strong>:<br> Mozilla/5.0 (iPad; U; CPU OS 4_3_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8G4 Safari/6533.18.5 </p> <p><strong>Mobile Safari when launched from shortcut</strong>:<br> Mozilla/5.0 (iPad; U; CPU OS 4_3_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Mobile/8G4 </p> <p>There are two actions in web app: Login and Main. User is required to authenticate using Login (forms authentication is used), before accessing Main. After signing in user is automatically redirected to Main (redirect is done using js, authentication is done via XmlHttpRequest). </p> <p>There are couple cases that help grasp what's exactly going on:<br> 1. Restart IIS Express<br> 2. Open Fiddler<br> 3. Login to web app using Chrome<br> 4. In Fiddler drug &amp; drop get request to Main to request builder<br> 5. Change user agent string to <strong>Mobile Safari</strong> and execute<br> 6. Verify Response 200<br> 7. Change user agent string to <strong>Mobile Safari Shortcut</strong> and execute<br> 8. Verify Response 200<br> 9. Change user agent back to <strong>Chrome</strong> and execute<br> 10.Verfiy Response 200 </p> <p>So far so good, but if we change the order of operations 5 and 7:<br> 1. Restart IIS Express<br> 2. Open Fiddler<br> 3. Login to web app using Chrome<br> 4. In Fiddler drug &amp; drop get request to Main to request builder<br> 5. Change user agent string to <strong>Mobile Safari Shortcut</strong> and execute<br> 6. Verify Response 302<br> 7. Change user agent string to <strong>Mobile Safari</strong> and execute<br> 8. Verify Response 302<br> 9. Change user agent back to <strong>Chrome</strong> and executre<br> 10.Verfiy Response 200 </p> <p>So, it looks like when sending <strong>Mobile Safari Shortcut</strong> user-agent string first, all subsequent attempts to access Main from Mobile Safari will fail. I know described behavior may sound crazy, but I asked couple more people to look into this and confirmed that it indeed is.</p> <p>Apparently it may have something to do with forms authentication. I tried setting non persistent cookie as someone suggested with no luck. Besides, as can be seen in test cases all requests used to reproduce a bug send authentication cookie acquired by Chrome and the only difference in all those requests was a user-agent string.</p> <p>What other choices except from debugging an Asp.Net MVC framework code do I have?</p> <p>Any help would be much appreciated!</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.
 

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