title: New Session is created for ajax call once deployed. But not on dev project why is this?
body: <p>I've been on the hunt for a solution for an issue that I discovered whilst trying to deploy a project Ive been working on.</p>
  
  <p>Everything works fine on the development test visual studio build but when i upload it to my iis 7 server and Ajax call that i have seems to have no session(they are null). I use the session to store my user. Ill past my code below can anyone see anything wrong with it?</p>
  
  <pre><code>    public JsonResult matchMaker(string request)
      {
          try
          {
              getCurrentUser();
          }
          catch
          {
              Response.StatusCode = 500;
              return null;
          }
          // nothing needed below cut it out as note relevant.
      }
      private void getCurrentUser()
      {
          // debug this
          HttpSessionStateBase a = Session;
          if (currentUser == null)
          {
              try
              {
                  // If a noUserInSessionEx is throw it will redirect them to login gracefully - Should also log why 
                  if (Session["CurrentUser"] != null)
                  {
                      currentUser = (UserModel)Session["CurrentUser"];
                  }
                  else
                  {
                      throw new noUserInSession("No user for current session");
                  }
              }
              catch 
              {
                  Response.Redirect("login");
              }
          }
      }
  </code></pre>
  
  <p>On my index page where the above method is being called via javascript i have</p>
  
  <pre><code>    public ActionResult Index()
      {
          Response.Write("Session variables: &lt;br&gt;") ;
          for( var i=0 ; i &lt;Session.Contents.Count ; i++){
              Response.Write(Session.Contents[i].ToString() + "&lt;br&gt;");
          }
          getCurrentUser();
          Response.Write(currentUser.Email);
          return View();
      }
  </code></pre>
  
  <p>Javascript is as below</p>
  
  <pre><code>    function executeAJAXRequest(datain, url) {
      returnObj = false;
      if (url != "" &amp;&amp; datain != "") {
          var request = $.ajax({
              type: "POST",
              async: false,
              cache:false,
              url: "http://localhost:51525/ajaxRequest/" + url,
              //contentType: "application/json; charset=utf-8",
              dataType: "json",
              data: "request=" + JSON.stringify(datain)
          })
          request.done(function (e) {
              //console.log("Sucessful Ajax:" + datain + " TO: " + url + "\n ResponseJSON: " + arguments[2].responseText);
              returnObj = eval(arguments[0]);
          });
          request.fail(function (textStatus) {
              console.log("Failure 2 Ajax (:()\n\n Data: " + datain
                                               + "\n TO: " + url +
                                              "\n ERROR: " + textStatus.statusText);
              returnObj = false;
          });
          return returnObj;
      }
      else {
          console.log("Failure 2 Ajax (:() No Info");
          return returnObj;
      }
  }
  </code></pre>
  
  <p>It shows me that correct user is stored and displays the email
  How ever my ajax is responding with the redirect to the login page.</p>
  
  <p>The session has a different id to the ajax session.</p>
  
  <p>Im so lost :S any help would be mega awesomeo :)</p>