简体   繁体   English

IIS Express 上的 HTTPS 到 HTTP ASP 共享 cookie 和会话

[英]HTTPS to HTTP ASP share cookie and session on IIS Express

How to configure IIS Express like IIS 8.0 for ASP classic.如何像 IIS 8.0 一样为 ASP 经典配置 IIS Express。

Yes when you use IIS 8.0 you have an option, "new ID on secure connection" on ASP settings page, set to false, the session is not lost between http and https是的,当您使用 IIS 8.0 时,您在 ASP 设置页面上有一个选项“安全连接上的新 ID”,设置为 false,会话不会在 http 和 https 之间丢失

But I don't find the same option on IIS Express, and when I redirect https on http, my session is lost.但是我在 IIS Express 上没有找到相同的选项,当我在 http 上重定向 https 时,我的会话丢失了。

Is for https to http for encrypt login page用于 https 到 http 的加密登录页面

"https://mysite:44300/login.asp" -> "http://mysite:4540/home.asp" 

Please help me.请帮我。

Thanks谢谢

Already worked it out in the comments but for completeness已经在评论中解决了,但为了完整性

IIS Express does not have any limits on functionality IIS Express 对功能没有任何限制

From ScottGu's Blog - Introducing IIS Express来自ScottGu 的博客 - 介绍 IIS Express
We have been working on a new flavor of IIS 7.x that is optimized for developer scenarios that we are calling “IIS Express”.我们一直致力于开发新版本的 IIS 7.x,该版本针对我们称为“IIS Express”的开发人员场景进行了优化。 We think it combines the ease of use of the ASP.NET Web Server with the full power of IIS.我们认为它结合了 ASP.NET Web 服务器的易用性和 IIS 的全部功能。 Specifically:具体来说:

  • It's lightweight and easy to install (less than 10Mb download and a super quick install)它轻巧且易于安装(下载量小于 10Mb,安装速度超快)
  • It does not require an administrator account to run/debug applications from Visual Studio从 Visual Studio 运行/调试应用程序不需要管理员帐户
  • It enables a full web-server feature set – including SSL, URL Rewrite, Media Support, and all other IIS 7.x modules它支持完整的网络服务器功能集——包括 SSL、URL 重写、媒体支持和所有其他 IIS 7.x 模块
  • It supports and enables the same extensibility model and web.config file settings that IIS 7.x support它支持并启用与 IIS 7.x 支持的相同的可扩展性模型和 web.config 文件设置
  • It can be installed side-by-side with the full IIS web server as well as the ASP.NET Development Server (they do not conflict at all)它可以与完整的 IIS Web 服务器以及 ASP.NET 开发服务器并排安装(它们根本不冲突)
  • It works on Windows XP and higher operating systems – giving you a full IIS 7.x developer feature-set on all OS platforms它适用于 Windows XP 和更高版本的操作系统 - 在所有操作系统平台上为您提供完整的 IIS 7.x 开发人员功能集

Having said that it is a bit trickier to work with because the GUI has very limited functionality.话虽如此,但使用起来有点棘手,因为 GUI 的功能非常有限。 The only option available is to use the powerful Configuration Schema in-built to IIS that is also supported by IIS Express.唯一可用的选项是使用 IIS Express 也支持的强大的 IIS 内置配置架构。

You will need to add the following value to the web.config file in the root of your IIS Web application.您需要将以下值添加到 IIS Web 应用程序根目录中的web.config文件中。

<system.webServer>
   <asp>
     <session keepSessionIdSecure="false" />
   </asp>
</system.webServer>

which is the equivalent to the GUI property New ID on Secure Connection .这相当于 GUI 属性New ID on Secure Connection

Note: This should work but if you have problems getting it to work you may find that adding it to the applicationHost.config works better.注意:这应该可以工作,但如果您在使用它时遇到问题,您可能会发现将它添加到applicationHost.config效果更好。 See Answer to Classic ASP session weirdness between HTTP and HTTPS请参阅对 HTTP 和 HTTPS 之间的经典 ASP 会话奇怪的回答

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM