Jul 12, 2017 09:55 AM|Eric Du|LINK
If the web server is restarted or the session information is reset, the user remains logged in but their Database name becomes blank and all pages start to error out.
According to your description, you say the user remains logged after restart the web server. I want to know where are you store these values(user name and password)? If you store them in the local, like cookie, you also could add database name to cookie.
Secondly, when you use data in the controller, you could add a check logical code in the controller. In this logical, if this database name is null, you could select it from the database then save it in the session.