Search code examples
asp.net-mvctempdata

TempData[] getting wiped


I have a integer stored in TempData, and it is getting periodically wiped for an unknown reason after 30-60 seconds of browsing around my site.

I have a break point on the place where the value is set and its never being set to null, yet somehow that value in TempData is getting nulled.

Any idea why this is happening?


Solution

  • I believe TempData only persists for the subsequent request. You might want to have a look at this.