I want to set the session timeout in the code so that it can come from a custom value.
Can I just do this in global.asax?
Session.Timeout = value;
to change the session timeout, write this code in the web.config file
or you can also set this in global.asax file as
Session.Timeout = 60; // in the Session.Start () event
this will increase the session expiration time.
On the MSDN page that describes the TimeOut property:
The Timeout property can be set in the Web.config file for an application that uses the timeout attribute of the sessionState configuration item, or you can directly set the value of the Timeout property using the application code.
So yes, you can assign a value to this property, and Global.asax is a good place to do it.
Global.asax
Source: https://habr.com/ru/post/1338085/More articles:Unsupported input characters - pythonDynamic pagination rich: dataTable / rich: datascroller with large data sets - javaadding a mouse to a link via javascript - javascriptCSS menu without javascript - htmlhttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1338084/in-aspnet-mvc-2-can-you-use-data-annotations-to-compare-two-fields-in-a-form-what-are-the-alternatives-if-not-data-annotations&usg=ALkJrhgb_bGclDHwmRLuML2iiwNyHkM-YQpass eventdata to event handler in javascript - javascriptSqlite3 virtual table lifetime - sqliteOne-to-Big Relationship: Getting Documents with One Request - mongodbBadPaddingException in Android Encryption - androidQuestion about class types - scalaAll Articles