Is it possible to control ASP.NET behavior when Sessionexpired? It seems that the default behavior sends the user to the root site. The desired result would be to send the user to the user page "Session Expired".
Session
To clarify, the time is running out SessionState(set the wait time to 1 minute to quickly test it):
SessionState
<sessionState mode="InProc" timeout="1"></sessionState>
The authentication cookie timeout is much higher to avoid confusion:
<authentication mode="Forms"> <forms loginUrl="SessionExpired.aspx" slidingExpiration="true" name=".ttpASPXAUTH" timeout="58" protection="All"></forms> </authentication>
/ , - , , - Application_AcquireRequestState Global.asax, , , .
global.asax Session_Start.
- :
if (!Request.Url.AbsolutePath.EndsWith("DEFAULT.ASPX", _ StringComparison.InvariantCultureIgnoreCase)) { string newPage = string.Format("ErrorPage.aspx?ErrorMessage={0}", _ System.Uri.EscapeUriString("Your session has expired.")); Logger.InfoFormat("{0} Session expired or illegal page access attempted: {1}", _ Utility.StoreRegisterForLog, Request.Url.ToString()); Response.Redirect(newPage); }
, , .
Source: https://habr.com/ru/post/1765128/More articles:function template pointer - c ++range-based number of columns - sql-serverWhich do you prefer: handling C ++ exceptions or passing a buffer to store error messages as a parameter? - c ++Check for referential integrity - mysqlSQLSTATE 24000 - Invalid cursor state - javaHttpContext.Current does not exist in IIS7 integrated mode - asp.netApplying Style to TextBlocks in ContentPresenter in Silverlight - stylesAnyway, so that Visual Studio ignores the script tag and assumes that anything in the script tag is html? - visual-studiopython: multiple inheritance and __add __ () in a base class - pythonДобавление коллекции мусора в iPhone? - objective-cAll Articles