How to prevent cookieless URLs?

自闭症网瘾萝莉.ら 提交于 2019-12-07 14:24:32

问题


As far as I know, I have disabled cookieless URLs in all places in web.config:

<system.web>
  <sessionState cookieless="UseCookies" />
  <authentication mode="Forms">
    <forms cookieless="UseCookies" loginUrl="~/loggain" timeout="2880" />
  </authentication>
  <anonymousIdentification enabled="false" cookieless="UseCookies" />
<system.web>

I still get the cookieless URLs from time to time, browsing our site. the path can look something like this: /(F(5wpzvCsOC[...snip...]9NXal01))/About/

The problem is that some of our URLs include product names that can be very long which results in a HttpException with "the length of the URL [...] exceeds the [...] maxUrlLength". Also Google seems to index these URLs, but I've added link canonical to try to avoid this.

It's an ASP.NET MVC 3 site running on IIS7.5, if that matters.

EDIT: I've had this problem put on the shelf for a while, but today it occurred to me that it could have something to do with caching. I cache some child actions to speed things up a bit, but if the request that gets cached contains the (F([stuff])), the cache naturally(?) contains these links. The question now is if I can prevent ASP.NET MVCs Html.ActionLink() from generating these links in the first place?

来源:https://stackoverflow.com/questions/9359527/how-to-prevent-cookieless-urls

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