从 cordova (android/ios webview) 或 Chrome > 80 在 windows 10 更新后访问站点时会话状态未保持
Session state not maintaining while accessing site from cordova (android/ios webview) or Chrome > 80 after windows 10 update
从 cordova(android/ios webview)访问 asp.net mvc 应用程序时,会话 ID 在每个请求中不断变化。
这仅在 windows 10 更新 之后发生,然后才能正常工作。
当我尝试使用 phonegap windows 客户端从 chrome/firefox 浏览器访问时,会话工作正常,但如果我在 android/ios 设备中安装该应用程序,它就无法工作。
根据回答
在web.config中添加下划线system.web
必须为 IIS 安装 URL Rewrite。
<rewrite>
<outboundRules>
<rule name="AddSameSiteCookieFlag">
<match serverVariable="RESPONSE_Set-Cookie" pattern="((.*)(ASP.NET_SessionId)(=.*))(SameSite=Lax)" />
<action type="Rewrite" value="{R:1};SameSite=" />
</rule>
</outboundRules>
</rewrite>
或
<sessionState cookieSameSite="None" />
从 cordova(android/ios webview)访问 asp.net mvc 应用程序时,会话 ID 在每个请求中不断变化。 这仅在 windows 10 更新 之后发生,然后才能正常工作。
当我尝试使用 phonegap windows 客户端从 chrome/firefox 浏览器访问时,会话工作正常,但如果我在 android/ios 设备中安装该应用程序,它就无法工作。
根据回答
在web.config中添加下划线system.web
必须为 IIS 安装 URL Rewrite。
<rewrite>
<outboundRules>
<rule name="AddSameSiteCookieFlag">
<match serverVariable="RESPONSE_Set-Cookie" pattern="((.*)(ASP.NET_SessionId)(=.*))(SameSite=Lax)" />
<action type="Rewrite" value="{R:1};SameSite=" />
</rule>
</outboundRules>
</rewrite>
或
<sessionState cookieSameSite="None" />