-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add a cookie based ITempDataProvider #5212
Comments
Here's one for MVC 5: https://github.com/brockallen/CookieTempData |
+1! (No reactions on mobile) |
/cc @blowdart any concerns with this? |
Ewww. Session in cookies? Remember there's a max size on cookies from a site. As long as it's ran through data protection, which will increase the size, and the cookies are limited to the app path, and they're HTTP Only and, if you're on HTTPS they're marked secure, then fine. |
Already had one implemented as a package... Anyway, maybe you could make the cookie name configurable. |
@DamianEdwards Why use Cookie or Session ? Create a |
@John0King No. The TempData persists the stored data until the next request. |
@ivaylokenov I still don't understand ? Does the second requset will get the TempData ? |
@John0King Yes, if you put data in the TempData, it will be there for the current and for the next request by default. The data needs to be persisted between the requests. Cookies or session are logical choices for the persistence. |
Using
TempData
today requires the manual configuration of session state. It would be great to have a provider available that uses cookies (protected with Data Protection) to round-trip the temp data information so that session state isn't required.While we likely can't change this to be the default (:cry:) it would be awesome to have it be available.
Temp data is a great solution for showing form success messages after a Post-Redirect-Get cycle and the need to use session state for that today is overkill.
@rynowak @sebastienros @danroth27
The text was updated successfully, but these errors were encountered: