multiple web application host under the same website on IIS
2017-11-10 10:54
751 查看
第一种方式,修改forms的name
how to set the forms authentication cookie pathassume 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的话,那么会导致使用域名无法登录的问题 。因为后台不识别了。
相关文章推荐
- unable to start debugging on the web server iis does not list an application that matches the launched url
- disable-the-loopback-check-for-specific-host-names-on-all-sharepoint-web-and-application-servers/
- Web Application Project is configured to use IIS. Unable to access the IIS metabase.(配置为使用IIS Web应用程序xxxx项目。无法访问IIS元数据库。)
- 虚拟机提示the virtual machine is in use by an application on your host computer的解决方案
- Installing multiple CAB files with the same setup application
- 异常A WebView method was called on thread 'JavaBridge'. All WebView methods must be called on the same
- 虚拟机the virtual machine is in use by an application on your host computer解决
- Cause by:All WebView methods must be called on the same thread[问题已解决]
- Install multiple instances of Reporting Services on the same computer (for use with Microsoft Dynami
- Sharepoint 2013 安装中 Config Application Server and Web Server role for the Server 失败 (iisext.vbs)
- Application Request Routing and the IIS 7.0 Web Management Service
- 183 Examine the following command that is used to duplicate a database on the same host: RMAN> RUN {
- How to Host ASP.Net Web API on IIS Server
- Visual studio cannot create or open the application because the Web server on this computer is...
- IIS Error:404.2 The page you are requesting cannot be served because of the ISAPI and CGI Restriction list settings on the Web server
- [Oracle Mgmt]Use RMAN to Duplicate Database in the Same Host (Based on Windows Platform)
- [Windows] [IIS] ISAPI and CGI Restriction list settings on the Web server
- Hosting Multiple Service Implementations On The Same Port With WCF
- android4.1 JELLY_BEAN:All WebView methods must be called on the same thread[问题已解决]
- [原][Android]All WebView methods must be called on the same thread.