We are using TempData in an ASP.NET MVC website to transmit success messages around the place, however we have discovered that setting TempData["message"]
does not work as expected the first time.
Instead of TempData["message"]
being available as part of the next response, we are finding that the ASP.NET_SessionId cookie is being set after setting TempData the first time.
All subsequent usages of TempData work as expected.
Is there something we can do to eagerly populate this ASP.NET_SessionId cookie so that TempData will always work?