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.
相关文章
- web服务器、Web中间件和Web容器的区别
- Summary: How to calculate PI? Based on Monte Carlo method
- 404 on _content/Syncfusion.Blazor/styles/bootstrap4.css
- The fileSyncDll.ps1 is not digitally signed. You cannot run this script on the current system.
- jQuery on()方法(函数)有哪些事件
- web安全day42:使用BurpSuite理解Web工作机制
- English trip V2 - 8 Holidays and Birthdays Teacher:Julia Key: at on in
- UE4 Run On Server与Run on owning client
- Install CUnit test framework on ubuntu
- Web在线文件管理器(web os) KODExplorer
- 在创建JSP时提示The superclass"javax.servlet.http.HttpServlet"was notfound on the Java Build Path错误
- .NET错误The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework
- Go Web:RESTful web service示例
- 转 MySQL active threads more than 40 on db3.***.com
- ORA-00245: control file backup failed; target is likely on a local file system
- Spark metrics on wordcount example
- App Launch Sequence on iOS 事件与UI
- The library 'xxx.jar' contains native libraries that will not run on the device. 解决方法(Eclipse)
- controller.php Call to a member function fetch() on a non-object问题的解决
- NoC (Network on chip) 基础 (2) :片上网络的拓扑结构(Topology)
- Web 之 Eclipse 搭建 Gradle 环境/并且运行 Gradle 工程(spring web)简单整理
- Web测试中,各类web控件测试点总结
- web压力測试-Web Bench
- The incident LOST_EVENTS occured on the master. Message: error writing to the binary log, Error_code
- Web 检测代码 web analysis 开源 open source
- web.xml中load-on-startup的作用
- load-on-startup在web.xml中的含义
- the resource is not on the build path of a java project错误
- 仅当使用了列列表并且 IDENTITY_INSERT 为 ON 时,才能为表'Address'中的标识列指
- Cannot define multiple Listeners on the same IP:port