title: How to cart an order in asp.net mvc 4
body: <p>My application is an on line order taking application.</p>
  
  <p>I want to know what is the right approach to cart the items. Although I am using session this way.</p>
  
  <p>I created a separate <code>sessionManaging</code> class and there I have properties that will hold the session like this:</p>
  
  <pre><code>public static List&lt;custHeader&gt; currOrderItemCustomizationSession
  {
        get
        {
           if (HttpContext.Current.Session["currOrderItemCustomization"] != null)
              return ((List&lt;custHeader&gt;)HttpContext.Current.Session["currOrder"]);
           else
              HttpContext.Current.Session["currOrderItemCustomization"] = 
                                                           new List&lt;custHeader&gt;();    
           return (List&lt;custHeader&gt;)
                      HttpContext.Current.Session["currOrderItemCustomization"];
          }
          set
          {
              HttpContext.Current.Session["currOrderItemCustomization"] = value;
          }
      }
  </code></pre>
  
  <p>There are other properties also like <code>currOrder</code>, <code>currOrderItem</code>, <code>currOrderItemCustomization</code> and I applied the same way session idea to them too.</p>
  
  <p>But when I set session and try to access in controller it always null.</p>
  
  <pre><code>public ActionResult GetProductCustomization(int pId)
  {
      List&lt;custHeader&gt; custHeader =
                        reposCustomization.GetHeaderCustomization(pId);
       cOrderSession.currOrderItemCustomizationSession = custHeader; 
       return PartialView("_customization", custHeader);
  }
  </code></pre>
  
  <p>Here when I check it with break point I find  <code>cOrderSession.currOrderItemCustomizationSession</code> this is null always. </p>