title: Async post to controller that returns JSon in Umbraco
body: <p>I am implementing my existing MVC project into Umbraco. In my existing project I have async ajax posts to my controllers using jQuery. Using Umbraco SurfaceController, the task will look like this:</p>
  
  <pre><code>public class MySurfaceController: SurfaceController
  {
      [HttpPost]
      public JsonResult PostThatReturnsJSon(myModel model)
      {
  
        // Some logic here that involves 
        // HttpContext.Current.Session["SomeSessionVariable"];
  
          string message = string.Format("Successfully processed");
          return Json(new { Success = true, Message = message });
      }
  }
  </code></pre>
  
  <p>This will not work, and by reading articles about Umbraco Surface Controllers, it is stated that Surface Controllers are only designed for "normal" form posts and for returning i.e. "CurrentUmbracoPage".</p>
  
  <p>Then there is the UmbracoApiController, but since an ApiController is stateless, it is not possible to use logic that involves sessions or cookies.</p>
  
  <p>I would be thankful if someone has a hint to a solution or best practice for this.</p>
  
  <p>Best regards</p>