Tech
Forums
Jobs
Books
Events
Videos
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
1
Answer
When to use TempData vs Session in ASP.Net Core ?
Priyu Kale
7y
151
1
Reply
People who used TempData in ASP.NET MVC, probably knows that by default TempData is stored in a Session state. This means that the web application must have sessions enabled. Now, the ASP.NET Core 2.0 gives two TempData providers; a Cookie based and a Session State-based. This blog shows how to use both of them in an application in ASP.NET Core.
By default, ASP.NET Core 2.0 makes use of cookies based TempData provider. This means values of TempData are stored in cookies present in the client’s machine. Since TempData gest stored in cookies you don’t require Session state through the session state middleware.
So how to store TempData in cookies that coulde be useful it ?
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Reading a cookie from another web site
display labels text dynamically in mvc