【发布时间】:2018-05-18 09:17:54
【问题描述】:
当从 IE 访问托管在 Intranet 上的 ASP.NET MVC 应用程序时,ASP.NET_SessionId 不会在请求中发送。这发生在特定的测试服务上。在我们的开发服务托管相同的应用程序中,我看到发送了 ASP.NET_SessionId cookie。
以下是我从网络跟踪中看到的差异。 在不工作的服务器上。
<entry>
<pageref>1</pageref>
<startedDateTime>2018-05-17T12:01:50.566+00:00</startedDateTime>
<time>188</time>
<request>
<method>GET</method>
<url>http://Server1/Content/Graphics/Cancel16.png</url>
<httpVersion>HTTP/1.1</httpVersion>
<cookies/>
<headers>
在传递会话密钥 cookie 的服务器上。
<entry>
<pageref>0</pageref>
<startedDateTime>2018-05-16T13:31:47.415+05:30</startedDateTime>
<time>31</time>
<request>
<method>GET</method>
<url>http://localhost/site/Content/Graphics/Cancel16.png</url>
<httpVersion>HTTP/1.1</httpVersion>
<cookies>
<cookie>
<name>ASP.NET_SessionId</name>
<value>14zbzcehugb2dvsq0axwo5ud</value>
</cookie>
</cookies>
<headers>
为什么cookie信息不会在此服务器上发送。我已经验证了互联网选项隐私设置并且它们允许使用 cookie,但我理解这主要影响互联网站点。
【问题讨论】:
-
在 IE 中,您是否看到您的 URL 因添加了会话 ID 而被更改?另外 - 你使用的是什么版本的 MVC 和 IE?
-
@scgough Session Id 没有在 URL 中传递,我们使用的是 MVC 5.0 和 IE 11,.net 框架是 4.5.2
-
好的 - 没问题。这不是我当时想的:)
-
@scgough 请让我知道您对具有会话 ID 的 URL 的想法,在我的情况下,该 URL 正在使用开发服务器上的会话 ID 进行更改。但是在有问题的服务器上它没有被改变
-
你去 - 见下文
标签: asp.net-mvc session internet-explorer cookies