title: How do I access Request.cookies in an ASP.NET MVC controller?
body: <p>I'm trying to get a user ID stored in cookies via a common Controller file, which I can access throughout the site.</p>
  
  <p>I have created <code>FunctionsController</code> as a controller, with content as follows:</p>
  
  <pre><code>public static int loggedinUser()
  {
      return Convert.ToInt32(  request.Cookies["userid"].Value);
  }
  </code></pre>
  
  <p>I am unable to request any cookie items even if I tried with: </p>
  
  <pre><code>HttpRequestBase request = controllerContext.HttpContext.Request;
  </code></pre>