How do I customize the Forms Authentication cookie name?

*爱你&永不变心* 提交于 2019-12-06 17:25:31

问题


I have 2 websites running on localhost in different ports. As browsers do not differentiate port numbers when sending cookies, my forms authentication ticket from one site is being sent to the other

How do I solve this? I thought that a good solution would be to change the forms authentication ticket or one of the websites but I don't know how to do this.


回答1:


In your web.config:

<authentication mode="Forms">
  <forms name="{WhateverCookieNameYouWant}" loginUrl="LogOn.aspx" />
</authentication>


来源:https://stackoverflow.com/questions/3631617/how-do-i-customize-the-forms-authentication-cookie-name

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