Tech
Forums
Jobs
Books
Events
Interviews
Live
More
Learn
Training
Career
Members
Videos
News
Blogs
Login
Sign Up
Ask Question
1
Reply
When to use TempData vs Session in ASP.Net Core ?
Priyu Kale
Jan 17 2018 5:22 AM
128
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 ?
Upload Source Code
Select only zip and rar file.
Post
Reset
Cancel
Answers (
1
)
Next Recommended Forum
Reading a cookie from another web site
display labels text dynamically in mvc