I needed to redirect the request to another action with TempData for specific requests.I know TempData uses session to store data.
If a request reaches to server01 and the request redirected with TempData to another action , will the request remain on server01 or may it goes to server02 ? If it goes to server02 , I will not be able to handle TempData properly.
Is there a way to keep the request on server01 for specific redirections ? or do i have to create a cookie which points the data on my db and check the request if cookie exist ?
Regards
Note: Loadbalancing is handled by a device out of the network where the servers located and the servers are not in a IIS Web Farm.
You need to use
StateServerorSQLServerto store your sessions instead ofInProc. Another possibility is to configure your load balancer to always send requests from the same IP to the same server.All those are very bad ideas of course. The best way to achieve that is to simply get rid of the session and TempData and design your application in a stateless, RESTFul manner. My favorite
sessionStatemode is the following: