def METHOD_NAME(test_client_factory):
    app = Starlette(
        routes=[
            Route("/view_session", endpoint=view_session),
            Route("/update_session", endpoint=update_session, methods=["POST"]),
        ],
        middleware=[Middleware(SessionMiddleware, secret_key="example", max_age=None)],
    )
    client: TestClient = test_client_factory(app)
    response = client.post("/update_session", json={"some": "data"})
    assert response.json() == {"session": {"some": "data"}}
    # check cookie max-age
    set_cookie = response.headers["set-cookie"]
    assert "Max-Age" not in set_cookie
    client.cookies.delete("session")
    response = client.get("/view_session")
    assert response.json() == {"session": {}}