我如何自定义窗体身份验证cookie的名字吗? [英] How do I customize the Forms Authentication cookie name?

查看:139
本文介绍了我如何自定义窗体身份验证cookie的名字吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个网站在不同的端口本地主机上运行。由于浏览器发送cookie时不区分端口号,从一个网站我的窗体身份验证票被发送到其他

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.

推荐答案

在你的web.config:

In your web.config:

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

这篇关于我如何自定义窗体身份验证cookie的名字吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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