Strange Url's in ASP.NET site
My asp.net 4 website url format is http://www.somesite.com/ShowProduct.aspx?ID=3330
but it sometimes gets changed to
http://www.somesite.com/(S(ghtef0vy5fgfdjgdfgderd55)X(1))/ShowProduct.aspx?ID=3330
or
http://www.somesite.com/ShowProduct.aspx?ID=3330&AspxAutoDetectCookieSupport=3330
How can i prevent this. I want all url's to be of this format only
http://www.somesite.com/ShowProduct.aspx?ID=3330
UPDATE:
I just saw that I have 开发者_如何转开发three entries
<authentication mode="Forms">
<forms cookieless="UseCookies" loginUrl="~/NoAccess.aspx" name="FORMAUTH"/>
</authentication>
and
<sessionState cookieless="AutoDetect"/>
and
<anonymousIdentification cookieless="AutoDetect" enabled="false"/>
What disadvantage will it have if I remove cookieless. WIll it break earlier bookmarked urls? Also how should both the config entries be rewritten so that i use cookies?
You've got a config that looks like this:
<configuration>
<system.web>
<sessionState mode="InProc" cookieless="AutoDetect" timeout="20"/>
</sessionState>
</system.web>
</configuration>
What you want is to remove the "cookieless" attribute so it defaults to "UseCookies"
http://msdn.microsoft.com/en-us/library/h6bb9cz9.aspx
You need to check the membership cookie settings for browsers, try looking under
<authentication mode="Forms">
<forms ...>
And make sure that you have cookies="userCookies"
set.
This usually means you are using cookieless session storage, and ASP.net alters the url to keep track, see MSDN for appropriate web.config configuration.
精彩评论