I have a web application created using .Net Framework 4.6.1. Recently, I started getting complaints from users that they were redirected to the login page. It only happens when session data is not found. I check for the user's session variable in Master page. Interestingly, it happens with only a few users randomly and no one can reproduce the issue. The web application is hosted on Windows Server 2016 using IIS 10. I use "InProc" session state and the setting I use in web.config is below.
<httpCookies sameSite="Strict" httpOnlyCookies="true" requireSSL="true" />
<httpRuntime targetFramework="4.6" maxRequestLength="30720" requestValidationMode="4.0" executionTimeout="300" enableVersionHeader="false"/>
<sessionState mode="InProc" timeout="240" cookieSameSite="Strict" cookieName="ASP.NET_SessionId"/>
I don't use a load-balancer and have set worker process to 1. I checked logs in EventViewer and didn't find any application level exceptions. There aren't any application pool recycles during the random logout time.
Has anyone had similar issues? What could be wrong in the configuration file? Any help would be appreciated. Thank you in advance.