title: MVC4: how to set session variable to null in javascript
body: <p>I am using MVC session variable in Razor view javascript. But if I want set that session value to null how to do that?</p>
  
  <pre><code> function UpdateMembershipJavascriptObject() {
          var tempMembership = @Html.Raw(JsonConvert.SerializeObject(Session["Membership"]));
          if (tempMembership) {
  
              membershipData.updateMembership(tempMembership);
              updateSubtotal();     
              //here I set to null
          }
      }
  </code></pre>
  
  <p>I tried <code>'@Session["Membership"]' = null</code> but getting error on <code>= null</code> on the browser. </p>