How can I remove the ASP.NET Session ID from my URL?

前端 未结 2 1059
旧巷少年郎
旧巷少年郎 2020-12-11 18:05

How can I remove the identifier from my URL?

In this example URL I need just index.aspx, how do I remove (S(w0uz0245gtucb3am0k5w5g55))?

相关标签:
2条回答
  • 2020-12-11 18:37

    Your webserver is rewriting your urls to include the session state because you have configured your site to not use cookies.

    If you look at your site's web.config file, you will probably find this line:

    <sessionState cookieless="true" />
    

    If you change the value to "false" if will solve your problem (or just remove the line entirely - the default value is false)

    More information about this configuration can be found here and here.

    0 讨论(0)
  • 2020-12-11 18:45

    You could wrap your entire application in an iFrame. Nobody would see the long URL.

    0 讨论(0)
提交回复
热议问题