我有一个使用RedirectToAction的ASP.Net MVC3站点,如下所示:
return RedirectToAction("Index", interstitialController,
new { userName = model.logInInfo.UserName, redirectString = redirectUrl, authToken = login.authenticationToken, reason = login.reason, status = login.status, provider = login.provider });
由于某种原因,这导致IE10将其生成为请求:
https://site.com/(F(7vkS9Als2GF4acdwa9JNTwHsOkeFIsGcdMGU-FIT0X1IC3UwpkeZrPvTp1WmCbC7aY890yhpaeS4dadGjjUrym9Z_UOHYUUezRjD_buWV8pJU35yl2MHLz_CqzpJx65UyW5qDYdBJ8RMVj5kp02eaKzhX2--JcFvwPsYKeGk11t5MHWU4sbnFYw7keYlAuB5p4_JSVnn99SS28M8wWjQPNzw89G5qXwFRyrCYgIDDrWUUsefofkfEB66gIF2Abet0))/Interstitial/Index?userName=user.name%40earthlink.net&redirectString=http%3A%2F%2Fwww.site.com%2Fcos_auth%2Fauthenticate.asp%3F_auth_token%3DPTZPGf5FDdVAtkXRXRd1piW5jTYSmjyraiQ79LEvrPsaf4kNDQLbJW%252bG5vZtRnSOZ50mLVm%252frF7Ne16uwQVXOOsnBzSeXj9RIUaEIpjmtFCUWOVDEldrVpIL6KBJasJ%252bac2pzS1oSKAqAK2kywt869NGQdWDM7u0%252fRHVikatRIHv8SpXiyz94eeaBEraKAnz%26persist%3D1&authToken=PTZPGf5FDdVAtkXRXRd1piW5jTYSmjyraiQ79LEvrPsaf4kNDQLbJW%2BG5vZtRnSOZ50mLVm%2FrF7Ne16uwQVXOOsnBzSeXj9RIUaEIpjmtFCUWOVDEldrVpIL6KBJasJ%2Bac2pzS1oSKAqAK2kywt869NGQdWDM7u0%2FRHVikatRIHv8SpXiyz94eeaBEraKAnz&status=Success&provider=COS
这应该是这样的:
https://site.com/Interstitial/Index?userName=user.name%40earthlink.net&redirectString=http%3A%2F%2Fwww.site.com%2Fcos_auth%2Fauthenticate.asp%3F_auth_token%3DPTZPGf5FDdVAtkXRXRd1piW5jTYSmjyraiQ79LEvrPsaf4kNDQLbJW%252bG5vZtRnSOZ50mLVm%252frF7Ne16uwQVXOOsnBzSeXj9RIUaEIpjmtFCUWOVDEldrVpIL6KBJasJ%252bac2pzS1oSKAqAK2kywt869NGQdWDM7u0%252fRHVikatRIHv8SpXiyz94eeaBEraKAnz%26persist%3D1&authToken=PTZPGf5FDdVAtkXRXRd1piW5jTYSmjyraiQ79LEvrPsaf4kNDQLbJW%2BG5vZtRnSOZ50mLVm%2FrF7Ne16uwQVXOOsnBzSeXj9RIUaEIpjmtFCUWOVDEldrVpIL6KBJasJ%2Bac2pzS1oSKAqAK2kywt869NGQdWDM7u0%2FRHVikatRIHv8SpXiyz94eeaBEraKAnz&status=Success&provider=COS
在兼容模式下,它在IE10上运行正常,但在非兼容模式下则不行。不确定是什么导致了这一点。正如您所看到的,它正在向请求中插入一些垃圾,导致它失败。有没有人见过这个?
答案 0 :(得分:4)
垃圾看起来像无cookie会话中发生的事情。
如果您将web.config更改为<forms cookieless="UseCookies"
,则会删除该内容。
来自MSDN FormsAuthentication.CookieMode:
CookieMode属性反映了cookieless的值 表单配置元素的属性。 CookieMode属性 确定是否将存储FormsAuthenticationTicket值 在浏览器中的会话cookie中或存储在QueryString中 属性。