I need to limit the session lifetime for certain users.
The problem is, max_age is set when the middleware is created and it does not seem to be available to update after that.
From looking at the middleware code, it looks like the only solution is to create a custom middleware with the required functionality. Is there a better solution?