Reputation: 1811
When issuing a redirect from the server after login, using:
return Redirect("/Some/Location");
This works perfectly in any browser except Chrome Mobile on iPad. In the case of this browser, the Location in the repsonse for the redirect is of the form:
Location: /(F(kE-dzlf...lots of random characters))/Some/Location
The question is, why is this random string of characters added to the redirect URL returned from the server?
Unfortunately, due to various routing issues this causes serious problems for the application.
On further investigation we have found that the same problem can be reproduced using desktop Chrome on Windows and spoofing the browser User Agent to be the same as Chrome Mobile on iPad, eg.
Mozilla/5.0 (iPad; CPU OS 6_1_3 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) CriOS/27.0.1453.10 Mobile/10B329 Safari/8536.25
It appears that there is some strange behaviour happening with particular user agent strings on the MVC server. Even various sub-strings of the above string produce the same behaviour.
We are speculating that this is perhaps some kind of cookie passing method, but we are not sure.
Thanks.
Edit: The solution to this problem can be found here: Asp.Net Forms Authentication when using iPhone UIWebView
Upvotes: 1
Views: 672
Reputation: 2243
It's because the browser doesn't have cookies enabled, OR IIS is assuming the user agent doesn't support them. The redirect is injecting the SessionID of the users session into the URL. I am not particularly familiar with MVC but would suspect that this is controlled in the web.config file just as with WebForms.
http://msdn.microsoft.com/en-us/library/h6bb9cz9(v=vs.71).aspx
Upvotes: 3