4

I have a jQuery Mobile page that works ok in Safari on iPhone (iOS 5+). And when clicking at this link...

@Html.ActionLink("Click to download", "Download", "Home")

...I am taken to myapp.com/Home/Download

When clicking the same link in Chrome on iPhone I'm taken to myapp.com/(F(LzXF8gDEEPPgR7F_UZ0wf2uWg1e-aK1mgwtvzxCTIgflM43gYVEY06XIIq91OLlyjnRXo78AXHQLoXMUXRjOLKQltEhrsYgmTnSNsHzBfl01)) /Home/Download

Does anyone have any idea why the URL gets so messed up? (From that url no subsequent link works..)

3 Answers 3

8

Your user agent (browser) doesn't support cookies or has cookies disabled. In this case ASP.NET falls to a compatibility mode in which it tracks user Sessions by appending the session id in the url. So now all your urls will have this id. It's perfectly normal behavior.

The same will happen not only with ASP.NET Session but with Forms Authentication cookies. You could disable this behavior for ASP.NET Session in web.config by forcing to always use cookies:

<sessionState cookieless="UseCookies" />

Obviously if the user disables cookies, your application will simply crash as it won't be able to track users. And absolutely the same goes for the forms authentication cookies:

<authentication mode="Forms">
    <forms loginUrl="~/Account/LogOn" timeout="2880" cookieless="UseCookies" />
</authentication>
3
  • Thanks! However, my chrome browser did have cookies enabled. It seemed like asp.net anyway thought that it hadn't. If I disable cookies in the user agent I cannot even login to the site. If I enable it, I can login but ASP.NET still sees some problems and falls into that compatibility mode. However, cookieless="UseCookies" in <authentication mode... did the trick.
    – Cotten
    Jul 3, 2012 at 15:40
  • You should not have to set this as it is defaulted to use cookies.
    – MarkM
    Sep 23, 2013 at 0:14
  • See my response, I feel this is a bug.
    – MarkM
    Sep 23, 2013 at 0:15
0

I had the same problem and,

<authentication mode="Forms">
    <forms loginUrl="~/Account/LogOn" timeout="2880" cookieless="UseCookies" />
</authentication>

solved my problem..

I thing you have to force browser for using cookies because when I checked my settings on my ipad, chrome was already allowing them.

Thanks again..

0

I realize this is an older post, but..

I believe this is a bug with the newest release of chrome iOS v 30.0.1599

As Daren stated this is the .net framework using the URL to hold the authentication data that otherwise would be in the auth cookie. This is called cookieeless session.

.net should not be interpreting the user agent as one that does not support cookies.

I added testing Request.Browser.Cookies to my login page and am seeing this version of chrome showing as false. This is certainly a bug in the chrome release. This seems to only happen after some post backs and will not resolve itself even with clearing the cookies and data and cashe the content settings.

The only way to solve is uninstalling chrome and using Safari. I am using ios7.

I would live to know how to resolve this but currently we are advising our clients who use iOS chrome to not update or use Safari and uninstall....

Mark

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.