title: User.Identity.GetUserId() return null
body: <p>Based on <a href="http://blogs.msdn.com/b/webdev/archive/2013/10/20/building-a-simple-todo-application-with-asp-net-identity-and-associating-users-with-todoes.aspx" rel="nofollow">this article</a> and the source code in github associated with this tutorial I am trying to implement a mvc application where users have individual resources.</p>
  
  <p>I have the authorize attribute on my controller and if I am not logged in I will be redirected to the login page. I can see my user name on the top of the page so I assume things are fine. But then I try a create action on another controller and finds that currentUser is null.</p>
  
  <p>This seem to happen in a random way which makes it very frustrating. But lately only failing.</p>
  
  <p>Could it be something with creation of the database? I'm using Code First.</p>
  
  <pre><code> [Authorize]
  public class ShopsController : Controller
  {
      private ApplicationDbContext db;
      private UserManager&lt;ApplicationUser&gt; manager;
  
      public ShopsController()
      {
          db = new ApplicationDbContext();
          manager = new UserManager&lt;ApplicationUser&gt;(new UserStore&lt;ApplicationUser&gt;(db));
  
      }
  
  
      // GET: Shops
      public ActionResult Index()
      {
          var currentUser = manager.FindById(User.Identity.GetUserId());
          var shops = db.Shops.ToList().Where(shop =&gt; shop.Owner.Id == currentUser.Id);
          return View(shops);
      }
  </code></pre>