0

When accessing an ASP.NET MVC application hosted on intranet from IE, the ASP.NET_SessionId is not sent in the request. This occurs on specific test serves. On our development serves hosting the same application, i see that the ASP.NET_SessionId cookie is sent.

Below is the difference i see form the network trace. On the server that not working.

<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>

The on the server where the session key cookie is passed.

<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>

Why would the cookie information not sent on this server. I have verified the internet option privacy setting and they allow cookies, but what i understand is this affect mainly the internet sites.

ARV
  • 1,111
  • 5
  • 22
  • 46
  • In IE, do you see your URLs being altered with the session ID added? Also - what version of MVC and IE are you using? – scgough May 18 '18 at 09:31
  • @scgough The Session Id is not passed in the URLs, we are using MVC 5.0 and IE 11 and the .net framework is 4.5.2 – ARV May 18 '18 at 09:38
  • OK - no problem. This isn't what I was thinking of then :) – scgough May 18 '18 at 09:42
  • @scgough Please can you let me know what you were thinking about with the URL having session ID, In my case, the URL is getting altered with the session ID on dev server. But on the server having problem it is not getting altered – ARV May 18 '18 at 12:13
  • there you go - see below – scgough May 18 '18 at 12:33
  • In my case the problem was because of having a underscore'_' in the host name added for the site and IE was not happy with that and it prevented sending the cookie – ARV May 21 '18 at 10:31

2 Answers2

1

Here you go Arvind.

Please note, this is just based on an old bug I experienced and might not be relevant to this exact case

My theory was re: something I came across a while ago using MVC3 and IE10/11.

Something to do with .NET not recognising the IE browser signature.

Add an App_Browsers folder in the root of your site then drop in BrowserFile.browser containing:

<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>

...and everything works again. It was an IE specific issue.

scgough
  • 5,099
  • 3
  • 30
  • 48
0

Finally the problem was because of having a underscore'' in the host name setup for the application. The IE, seems to have problem when the host name is set with '', the IE prevents sending session cookies.

Answer from here helped me identify the issue

ARV
  • 1,111
  • 5
  • 22
  • 46