Internet Explorer 11 Session Issue with Asp.Net 4.0

≡放荡痞女 提交于 2019-12-21 03:29:13

问题


I am experiencing a strange problem i have developed a website in asp.net 4.0, it works fine on all the browsers as i am handling sessions as well so user has to login to use the site.

On Internet Explorer 11 when you go the the website url it appends strange string in the url.

When you logs in to the website, and click an link inside it logs you out.

I am not sure why this is happening, as i have tested this on locally it works fine, but when the files are uploaded to server and you open the link from IE11 it creates this problem.

Anyone could help me with this, please.

This is the url i get

http://wwww.someurl.com/FM2/(S(iyrnv2rrbds5uisv2qqc3rjy))/login.aspx

Thanks


回答1:


There seems to be an issue with the new user agent string (most sites don’t recognize the new IE) and thus MVC doesn’t enable cookies by default

Force the use of cookies in the authentication token by adding the cookieless attribute in your forms authentication element as follows

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

Source: http://botsikas.blogspot.co.uk/2013/09/ie11-and-aspnet-session-cookies.html



来源:https://stackoverflow.com/questions/19725827/internet-explorer-11-session-issue-with-asp-net-4-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!