db checks connection, if correct saves to a session
fixed #1