1

I am using ASP.NET MVC4, .NET Framework 4.5 and IIS8. My application can be invoked via the url http://vm_windows8. On first request, the following code snipped will be executed:

Session["Value"] = "MyStoredValue";

On a later request the value will be extracted from the session:

if(Session["Value"] == null)
    throw new Exception("Session 'Value' is null.");

// ... code ...

Every time, the Session["Value"] is null. But when I remove the underscore from the url http://vmwindows8 the session is not null all works as expected.

Does anyone know the issue / solution using underscores "_" in the url in combination with sessions?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Simon
  • 4,157
  • 2
  • 46
  • 87

1 Answers1

2

Sessions and cookies are blocked by the browser if you make use of special characters

https://support.microsoft.com/en-us/kb/316112

Bajju
  • 925
  • 11
  • 27