Chrome更新,会话丢失,asp.net 4.6付款webapp

时间:2020-09-17 06:54:59

标签: asp.net session session-cookies

在chrome更新后,当重定向到我们的付款服务时,会话丢失了,解决方法是在web.config文件上添加一些更改并安装IIS URL Rewrite Module 2,该功能在部署后确实可以在服务器上运行!我的问题是我该如何在本地计算机上重现此问题,也已经在本地计算机上安装了IIS URL Rewrite Module 2

来自web.config的代码:

 <system.webServer>
 <rewrite>
  <outboundRules>
    <rule name="SessionCookieAddNoneHeader">
      <match serverVariable="RESPONSE_Set-Cookie" pattern="(.*ASP.NET_SessionId.*)" />
      <!-- Use this regex if your OS/framework/app adds SameSite=Lax automatically to the end of the cookie -->
      <!-- <match serverVariable="RESPONSE_Set-Cookie" pattern="((.*)(ASP.NET_SessionId)(=.*))(?=SameSite)" /> -->
      <action type="Rewrite" value="{R:1}; SameSite=None" />
    </rule>
  </outboundRules>
</rewrite>
</system.webServer>

0 个答案:

没有答案