### Body

When user is logged in with a valid session and deactivated, refreshing the browser/reusing the session leads to an infinite redirection loop (which is stopped quickly by browser detecting the situation).

## Steps to Produce:

Make sure you are using two different browsers.
In Browser A:

Login as the normal user.

In Browser B:
1. Login as admin.
2. Go to Security > List Users
3. Disable a user by unchecking this box:
![image](https://github.com/apache/airflow/assets/595491/0c1af0c2-2203-466f-8329-cf03aa138695)

4. Now in browser A, refresh the page.
You'll see a message like this:
![image](https://github.com/apache/airflow/assets/595491/5d9292c7-1364-46c0-8d26-5426a095112e)
In the server logs, you'll see that a lot of requests have been made to the server.
![image](https://github.com/apache/airflow/assets/595491/0599869a-a2bd-48a4-9f68-5789f24bfa16)

# Expected behaviour

There should be no infinite redirection, but the request for the inactive user should be rejected and the user should be redirected to the login page.


### Committer

- [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.
return next((cookie for cookie in client.cookie_jar if cookie.name == "session"), None)
def test_session_cookie_created_on_login(user_client):
    assert get_session_cookie(user_client) is not None
def test_session_inaccessible_after_logout(user_client):
    session_cookie = get_session_cookie(user_client)
    assert session_cookie is not None
    resp = user_client.get("/logout/")
    assert resp.status_code == 302
    
    user_client.set_cookie("session", session_cookie.value)
    user_client.get("/home/")
    assert resp.status_code == 302
def test_invalid_session_backend_option():
    @dont_initialize_flask_app_submodules(
        skip_all_except=[
            "init_api_connexion",
            "init_appbuilder",
            "init_appbuilder_links",
            "init_appbuilder_views",
            "init_flash_views",
            "init_jinja_globals",
            "init_plugins",
            "init_airflow_session_interface",
        ]
    )
    def poorly_configured_app_factory():