Changing the default value of session's variable timeout in asp.net mvc

前端 未结 5 1021
半阙折子戏
半阙折子戏 2020-12-30 03:31

I have an Asp.net Mvc application with razor views engine , in which i used a variable Session[\'user\'] : when an user log on the application Session[\'u

5条回答
  •  庸人自扰
    2020-12-30 03:56

    So how can i set the timeout of the session's variable unlimited until it is changed by program?Any suggestions?

    You can't set timeout value to unlimited.

    You can increase the time out value in minutes using the timeout attribute of sessionState element in web.config.


    SESSION STATE SETTINGS

    By default ASP.NET uses cookies to identify which requests belong to a particular session. If cookies are not available, a session can be tracked by adding a session identifier to the URL. To disable cookies, set sessionState cookieless="true". (120 = minutes)

    
    

    Check out this Session-Time out

提交回复
热议问题