我可以更改 FormsAuthentication cookie 名称吗? [英] Can I change the FormsAuthentication cookie name?

查看:25
本文介绍了我可以更改 FormsAuthentication cookie 名称吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以更改 FormsAuthentication cookie 名称吗?

Can I change the FormsAuthentication cookie name?

如果是,如何?

我遇到的问题是,当我在同一个域中部署两个 Web 应用程序时,当有人登录时,第二个应用程序将自动注销,因为它们使用相同的身份验证的 cookie 名称.

The problem which I've got is that when I have two web applications are deployed in the same domain then when anyone is logged in then the second one will be automatically logged out because they use the same Authentication's cookie name.

推荐答案

您可以在您的 web.config 文件中进行调整:

You can adjust it in your web.config file:

<authentication mode="Forms">
  <forms name=".CookieName" loginUrl="LoginPage.aspx" />
</authentication>

这篇关于我可以更改 FormsAuthentication cookie 名称吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆