0

I have an ASP.NET MVC application that is configured to use SQL Server to save the session state. If there is an issue with the session state connection string (invalid password, server, etc) my application is redirecting to an error page (HomeController action).

The problem is that before it enters my controller action code it throws another error. Then it enters a death loop and the browser finally kills it.

If the session state database connection string is good, the error page presents as expected.

I want to stop this from happening and add some useful debugging information. This has to be happening somewhere in the base of the page that I can't seem to put my finger on. I don't understand the full page life cycle of an ASP.NET MVC page to know where to look.

Any help will be greatly appreciated.

3
  • 3
    When the SQL session connection fails redirect to a page that doesn't inherit the base page. When you redirect back to the HomeController, it tries again to setup the session connection, which fails and redirects back to the HomeController, this will repeat forever until the browser kills it.. Commented Sep 22 at 16:44
  • 1
    This should be a "never" event really. It indicates a misconfiguration in your deployment really, so should be verified before you even deploy. So not sure you need to go to huge lengths to make this work "nicely" Commented Sep 22 at 17:31
  • Check that your error route on the HomeController is marked as [AllowAnonymous]. If like the rest of the controller routes it is trying to validate the authentication/authorization and your session state has gone poof I'd expect you'd end up in a death loop. A misconfigured connection string might be a never event, but the session database going offline isn't. (Site won't work either way, but death loops don't help convey a problem and the site being down to the users) Commented Sep 22 at 20:47

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.