title: Cookie values updated but returns old values
body: <p>I have got a task to make Custom BreadCrumbs which will keep historical info of where the user got to the current point in an application. I have made a class for this purpose which Inherits from ActionFilterAttribute class and decorated the actions of the controller with that class, then in my OnActionExecuting override i save the historical view in a cookie and get the information out of the cookie in my customBreadCrumb partial view.
  Moreover, my customBreadCrumb partial view is inside of another partail view which in turn is in the Layout page. 
  The problem is that every time the code executes it returns old cookie value. To be more specific it returns previous value in current view.
  Here is my sample code.</p>
  
  <pre><code>public class CustomBreadCrumb : ActionFilterAttribute
  {
  
      public override void OnActionExecuting(ActionExecutingContext filterContext)
      {
          WriteCookie(string cValue);
          base.OnActionExecuting(filterContext);
      }
  
  
      private void WriteCookie(string CookieValue)
      {
          HttpCookie breadCrumbCookie = new HttpCookie("MyCookie");
          breadCrumbCookie.Value = CookieValue;
          breadCrumbCookie.Expires = DateTime.Now.AddYears(1);
          HttpContext.Current.Response.Cookies.Add(breadCrumbCookie);
      }
  
      public static string GetBreadCrumb()
      {
  
          if (HttpContext.Current.Request.Cookies["MyCookie"] != null)
          {
              return HttpContext.Current.Request.Cookies["MyCookie"].Value;
          }
  
          return string.Empty;
      }
  
  }
  </code></pre>
  
  <p>Here is my View</p>
  
  <pre><code>@{
      @CustomBreadCrumb.GetBreadCrumbs()
   }
  </code></pre>
  
  <p>Here is my sample controller</p>
  
  <pre><code>public class HomeController : BaseController
  {
      [CustomBreadCrumb]
      public ActionResult Index(int ID = 1)
      {
          //My logic
      }
   }
  </code></pre>