multiple web application host under the same website on IIS (authentication mode)
第一种方式,修改forms的name
how to set the forms authentication cookie path
assume you have already solved this issue somehow, but since I stumbled upon this question I thought I should add my few cents.
To solve the issue use different cookie names in web.config. Something like:
<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH_FOO"
loginUrl="public/login.aspx" cookieless="UseCookies" slidingExpiration="true"/>
</authentication>
and
<authentication mode="Forms">
<forms name=".ASPXFORMSAUTH_BAR"
loginUrl="public/login.aspx" cookieless="UseCookies" slidingExpiration="true"/>
</authentication>
第二种方式,修改forms的path,并且加上domain(必须添加) (forms的name是保持一致的)
需要注意的是,监视cookie的时候,每一个页面的cookie是独立的,需要分别用F12查看。
The name of forms keep the same, they have different path,(although the domains are the same but must set it)
<authentication mode="Forms">
<forms loginUrl="CMSPages/LISA_logon.aspx" defaultUrl="Default.aspx" name=".ASPXFORMSAUTH" timeout="1440" slidingExpiration="true" domain="localhost" path="/LISA_50_Dev_CMSWeb" />
</authentication>
<authentication mode="Forms">
<forms loginUrl="CMSPages/logon.aspx" defaultUrl="Default.aspx" name=".ASPXFORMSAUTH" timeout="1440" slidingExpiration="true" domain="localhost" path="/LISA_60_Dev_CMSWeb"/>
</authentication>
第二个方法的问题,在于限定了domain name,如果限定为localhost的话,那么会导致使用域名无法登录的问题 。因为后台不识别了。
扩展
查看单个页面的cookie
相关文章
https://weblog.west-wind.com/posts/2008/Jan/20/Forms-Authentication-and-path-in-the-forms-Tag
domain
When using cookie-based authentication tickets, this setting specifies the cookie's domain value.
The default value is an empty string, which causes the browser to use the domain from which it was issued (such as www.yourdomain.com).
In this case, the cookie will not be sent when making requests to subdomains, such as admin.yourdomain.com.
If you want the cookie to be passed to all subdomains you need to customize the domain attribute setting it to yourdomain.com.
path
When using cookie-based authentication tickets, this setting specifies the cookie's path attribute.
The path attribute enables a developer to limit the scope of a cookie to a particular directory hierarchy.
The default value is /, which informs the browser to send the authentication ticket cookie to any request made to the domain.
multiple web application host under the same website on IIS (authentication mode)的更多相关文章
- 基于Web的企业网和互联网的信息和应用( 1194.22 )
基于Web的企业网和互联网的信息和应用( 1194.22 ) 原文更新日期: 2001年6月21日原文地址: http://www.access-board.gov/sec508/guide/1194 ...
- Web 通信 之 长连接、长轮询(long polling)(转载)
基于HTTP的长连接,是一种通过长轮询方式实现"服务器推"的技术,它弥补了HTTP简单的请求应答模式的不足,极大地增强了程序的实时性和交互性. 一.什么是长连接.长轮询? 用通俗易 ...
- 极大提高Web开发效率的8个工具和建议(含教程)
面对复杂的 Web 应用的开发,良好的流程和工具支持是必不可少的,它们可以让日常的开发工作更加顺畅.更加高效.本文介绍了6个Web开发利器以及相关的教程,帮助你在开发.调试.集成和发布过程极大地提高效 ...
- spring web mvc中遇到的错误以及学习小记(持续记录)
错误:cvc-complex-type.2.4.a: 发现了以元素 'init-param' 开头的无效内容.应以 '{"http://java.sun.com/xml/ns/javaee& ...
- net core体系-web应用程序-4asp.net core2.0 项目实战(任务管理系统)-2项目搭建
系统要求 首先建议采用 Windows 10 专业版/企业版/教育版,且必须是64位操作系统,原因是docker装起来比较方便,Win7装起来比较麻烦,且不确定是否有其他问题(自己没有实践过) 其次W ...
- [转]Web 通信 之 长连接、长轮询(long polling)
本篇文章转载自Web 通信之长连接.长轮询(longpolling),版权归作者所有. 转者按:随着技术的发展,在HTML5中,可以通过WebSocket技术来完成长连接的开发,虽然如此,本文依然存在 ...
- Web 通信 之 长连接、长轮询(long polling)
基于HTTP的长连接,是一种通过长轮询方式实现"服务器推"的技术,它弥补了HTTP简单的请求应答模式的不足,极大地增强了程序的实时性和交互性. 一.什么是长连接.长轮询? 用通俗易 ...
- Web 通信 之 长连接、长轮询(long polling)(转)
基于HTTP的长连接,是一种通过长轮询方式实现"服务器推"的技术,它弥补了HTTP简单的请求应答模式的不足,极大地增强了程序的实时性和交互性. 一.什么是长连接.长轮询? 用通俗易 ...
- Core CLR 自定义的Host官方推荐的一种形式(第一种)
.Net Core CLR提供两种Host API访问 托管代码的形式,按照微软官方的说法,一种是通过CoreClr.DLL来直接调用托管生成的DLL程序集,另外一种是通过CoreClr里面的C导出函 ...
随机推荐
- 图解TCP/IP笔记(2)——数据链路
[转载请注明]https://www.cnblogs.com/igoslly/p/9396066.html ——终端节点之间的包传递 MAC寻址(物理寻址).介质共享.非公有网络.分组交换.环路检测. ...
- asp.net MVC 下拉多级联动及编辑
多级联动实现,附源码.当前,部分代码是参与博客园其它网友. 新增,前台代码: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 2 ...
- vm装xp安装成功后进入不了系统
1.如果是用虚拟光驱,你肯定步骤是先新建的虚拟机,再安装的虚拟光驱,所以会出现这样的问题.(请先安装虚拟光驱,再新建虚拟机,再用虚拟光驱加载镜像文件,问题解决)2.如果是直接使用的镜像,那么在GHOS ...
- Python 之beautifulSoup4解析库
一.节点选择器 from bs4 import BeautifulSoup if __name__ == '__main__': html = ''' <div> <ul> & ...
- PHP 之转换excel表格中的经纬度
<?php set_time_limit(0); include './plugin/PHPExcel/PHPExcel.php'; include './plugin/PHPExcel/PHP ...
- win10 ubuntu18双系统环境搭建
感谢前辈辛勤总结,根据这3篇文章成功配置了双系统 https://blog.csdn.net/qq_24624539/article/details/81775635 https://blog.csd ...
- cocos自动图集
对于图像资源,为什么要用图集,cocos官网的解释: 1.合成图集时会去除每张图片周围的空白区域,加上可以在整体上实施各种优化算法,合成图集后可以大大减少游戏包体和内存占用2.多个 Sprite 如果 ...
- js 图表转图片
最近项目上有个需求,是将一些teechart做的图表转换成图片插入自动生成的PDF里,Teechart绘图和如何生成PDF这些这里就不说了,这个任务比较别扭的一点是,图表自动生成,且整个过程中页面不能 ...
- hstack()与vstack()函数
ref: https://blog.csdn.net/csdn15698845876/article/details/73380803 1. hstack()函数 a,b只有一个维度:对第一个维度拼接 ...
- HDU - 2159 FATE(二维dp之01背包问题)
题目: 思路: 二维dp,完全背包,状态转移方程dp[i][z] = max(dp[i][z], dp[i-1][z-a[j]]+b[j]),dp[i][z]表示在杀i个怪,消耗z个容忍度的情况下 ...