ASP.NET_SessionId cookie未在IE浏览器的内部网站请求中发送

时间:2018-05-18 09:17:55

标签: asp.net-mvc session internet-explorer cookies

从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信息。我已经验证了互联网选项隐私设置,他们允许使用cookies,但据我所知,这主要影响互联网网站。

2 个答案:

答案 0 :(得分:1)

你去Arvind。

请注意,这只是基于我遇到的旧错误,可能与此确切的情况无关

我的理论是:我前一段时间使用过的MVC3和IE10 / 11。

与.NET无法识别IE浏览器签名有关。

在您网站的根目录中添加App_Browsers文件夹,然后放入BrowserFile.browser,其中包含:

<browsers>
  <browser refID="Default">
    <capabilities>
      <!-- To avoid wrong detections of e.g. IE10 -->
      <capability name="cookies" value="true" />
      <capability name="ecmascriptversion" value="3.0" />
    </capabilities>
  </browser>
</browsers>

......一切都有效。这是IE特定的问题。

答案 1 :(得分:0)

最后问题是因为有一个下划线&#39; &#39;在应用程序的主机名设置中。使用&#39; &#39;设置主机名时IE似乎有问题,IE阻止发送会话cookie。

Answer from here helped me identify the issue