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

2019-01-20 10:33发布

How can I remove the identifier from my URL?

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

http://www.example.com/(S(w0uz0245gtucb3am0k5w5g55))/index.aspx

2条回答
手持菜刀,她持情操
2楼-- · 2019-01-20 11:17

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

查看更多
Lonely孤独者°
3楼-- · 2019-01-20 11:24

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.

查看更多
登录 后发表回答