Skip to content
Discussion options

You must be logged in to vote

I think I discovered the problem. session_config is defined as:

session_config = ServerSideSessionConfig(
    ..., secure=True, ...
)

The problem seems to arise from the fact that I set secure=True, which means the cookie is not available in non https contexts. By changing the base_url of the TestClient to https://testserver.local, the session data is now available in the middleware.

Replies: 2 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@smac89
Comment options

Answer selected by smac89
Comment options

You must be logged in to vote
5 replies
@euri10
Comment options

euri10 Jan 17, 2026
Collaborator

@smac89
Comment options

@euri10
Comment options

euri10 Jan 21, 2026
Collaborator

@smac89
Comment options

@euri10
Comment options

euri10 Jan 22, 2026
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants