Redirect to login or dashboard depending on the session