TempData: Is It Safe?

前端 未结 5 2234
南笙
南笙 2021-02-18 15:04

I am using the TempData in order to preserve my model in when using a RedirectToAction. It works fine, but I have a nagging feeling that it might not b

5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-18 15:58

    Yes, TempData is backed by session storage, so if you are in a load balanced environment extra care must be taken when using it (sticky sessions, persistent session state, etc).

    TempData has been the de-facto choice when using the PRG pattern, and is what it was designed for.

    As to whether it's the right thing to do... it depends on your use case!

    PS Marathon Man.

提交回复
热议问题