Rename ASP.NET_SessionId

前端 未结 5 1392
孤独总比滥情好
孤独总比滥情好 2020-12-16 08:51

I need to rename the ASP.NET_SessionId cookie created by default by ASP.NET. Let\'s say I want it\'s named \"foo\". Is it possible?

相关标签:
5条回答
  • 2020-12-16 09:26

    I don't recall it correctly but I think you can rename it by changing the web.config file.

    Seach for the sessionState element of the web.config.

    0 讨论(0)
  • 2020-12-16 09:32

    See sessionState Element. look at the cookieName attribute, which will change it from the default of "ASP.NET_SessionId".

    0 讨论(0)
  • 2020-12-16 09:40

    Add to your web.config:-

    <system.web>
        <sessionState cookieName="foo" />
    </system.web>
    
    0 讨论(0)
  • 2020-12-16 09:45

    You can set this in the <sessionState> configuration setting in your web.config file:

    <system.web>
        <sessionState cookieName="myCookieName" />
    </system.web>
    
    0 讨论(0)
  • 2020-12-16 09:47

    Yes. You can do it in your web.config file:

    <sessionState cookieName="foo" />
    
    0 讨论(0)
提交回复
热议问题