title: Session seem to not work asp.net
body: <p>I am not sure why this happens. In the same program i am using sessions which has worked. Now i am trying to make my site compatible when the user does not send cookies (which should be simple). I wrote</p>
  
  <pre><code>long userId, loginId;
  //...
  //put data into cookies
  HttpContext.Current.Session.Add("userId", userId.ToString());
  HttpContext.Current.Session.Add("loginId", loginId.ToString());
  </code></pre>
  
  <p>and i see that they are null in this statement</p>
  
  <pre><code>var cookies = HttpContext.Current.Request.Cookies;
  long mUserId;
  string u, id;
  if (cookies["userId"] == null)
  {
      //these are null
      u = (string)HttpContext.Current.Session["userId"];
      id = (string)HttpContext.Current.Session["loginId"];
  }
  </code></pre>
  
  <p>In both cases (working and not working) after i set the session i call</p>
  
  <pre><code>HttpContext.Current.Response.Redirect("someUrl");`
  </code></pre>