문제

My MVC application is running under Windows Authentication.

I have used TempData at various places in my application. The problem is that, they get clear with session timeout. however, the Windows login is still running. How can I set them to remain intact until the user logs off his windows login.. I mean, there shouldn't be any timeout as such. is it possible?

도움이 되었습니까?

해결책 2

TO my understand, TempData only gets persist it's value till the next action, which is why it's called "Temp"Data. And a session will be only be able to maintain the data for current user session.

If you don't want timeout(which sounds really weird to me and i can smell bad code practice) then use Cache or persist data to database. You can keep the data as long as you want.

다른 팁

You can change session timeout value in the web config:

<sessionState mode="InProc" timeout="20"/>

Just change the minutes timeout value from 20 minutes to a higher value

e.g for 2 days:

<sessionState mode="InProc" timeout="2880"/>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top