在 ASP.NET MVC 4/5 应用程序发布的时候,遇到一个问题,在本应用程序中进行身份验证是可以,但不能和其他“二级域名”共享,在其他应用程序身份验证,不能和本应用程序共享,示例代码:

System.Web.Security.FormsAuthentication.SetAuthCookie("蟋蟀", true);

webconfig 配置如下:

<system.web>
<pages validateRequest="false"></pages>
<authentication mode="Forms">
<forms name=".DottextCookie" domain=".test.com" loginUrl="~/Account/Login" protection="All" />
</authentication>
<compilation debug="true" targetFramework="4.5.1" />
<httpRuntime targetFramework="4.5.1" requestValidationMode="2.0" />
</system.web>

比较“奇葩”的解决方式是:把 httpRuntime 节点中的“targetFramework="4.5.1"”去掉就好了,HttpRuntime.TargetFramework 属性参考:system.web.httpruntime.targetframework,感觉应该是应用程序的 Framework 版本和服务器 Framework 版本不一致所引起的,至于具体原因,尚不得知!

最新文章

  1. div实现自适应高度的textarea,实现angular双向绑定
  2. UIAlertController 部分用法及属性
  3. B样条基函数(cubic spline basis)
  4. Archlinux 上 Nginx + PHP + Mariadb + DiscuzX2.5 安装小记
  5. win10 EFI装ubuntu14.04双系统 及初始配置
  6. iOS xcode6 添加.pch文件
  7. Login 页面
  8. ASP.NET jquery ajax传递参数
  9. Jquery异步请求简单实例(转)
  10. 文字超出DIV的边框
  11. Objective-C学习篇03—继承
  12. 项目.c文件和.h文件关系
  13. Hadoop hdfs上传文件 权限问题
  14. 【linux之软件安装,rpm,yum】
  15. linux中probe函数中传递的参数来源(上)
  16. java内部类(转)
  17. 42028: Assignment 1 – Autumn 2019
  18. W3School 学习笔记
  19. ubuntu14.04上设置默认python命令是执行python3而不是Python2
  20. Python常用模块-时间模块(time&amp;datetime)

热门文章

  1. 使用nodeJs安装Vue-cli
  2. Python之路【第二篇】python基础 之基本数据类型
  3. Swift 3 and OpenGL on Linux and macOS with GLFW
  4. 手把手教android studio中安装Android Butterknife Zelezny (转)
  5. python网页抓取练手代码
  6. 搭建Linux+Jexus+MariaDB+ASP.NET[LJMA]环境
  7. ubuntu-14.04.2-desktop使用方法
  8. .NET中异常处理的最佳实践(译)
  9. 配置NHibernate将枚举保存为Oracle数据库中的字符串
  10. awk神器