The issue you're encountering seems related to the session timing out due to idle inactivity, which causes the session to expire. This results in the "Cannot read properties of undefined" error in your JavaScript when the user attempts to interact with the page after the session has expired. Since this works fine during development in Visual Studio but not when deployed, the problem likely stems from how the session timeout and cookies are managed in IIS or the ASP.NET application configuration.
Or Implement session expiration handling in JavaScript and/or server-side logic to gracefully handle expired sessions.
Or If necessary, investigate load balancing issues or use a centralized session store.