title: How to populate Controller.Request in ASP.NET MVC
body: <p>I want to use the <code>Request</code>, <code>Response</code> properties of <code>System.Web.Mvc.Controller</code> class to set and read cookies in the HTTP request and response. The reason to do so is - it obviates the need for writing utility classes that read from requests and populate data in some helper class. I can push all such code in custom base controller (from which all my controllers are derived from).</p>
  
  <p>So I have got following code in my `BaseController'</p>
  
  <pre><code>if (Request != null)
  {
     HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];
     if (authCookie != null)
     {
          HttpContext.User = new GenericPrincipal(new GenericIdentity(authCookie.Value), null);
          Thread.CurrentPrincipal = HttpContext.User;
     }
  }
  </code></pre>
  
  <p>but the <code>Request</code> is always null. How is this populated?</p>