ASP.net "Object reference not set to an instance of an object"
Posted on 2014-10-21
I know this is an age old problem, but I am having trouble with some legacy WebForms ASP.Net stuff that I must support. The code is well written, but the developer never took into account the predictable loss of session state after the default 20 minute timeout.
I know I can bump the timeout up a bit, but that is not the best solution. I just want the code to sense an error (globally) and reroute itself to the home page and throw a simple error such as, "Your session timed out".
I have other web sites that do just this. But what do I need to implement to make this happen? I don't want to go to each page of legacy code to check for a session variable.
Thanks in advance.