Closed oprypkhantc closed 4 years ago
Sorry, spoke too soon. Fixed one problem, caused another one.
Okay, I found the problem. We've used injection of Guard
in middlewares which caused the issue. Obviously, clearing an instance did not help as the old instance was still saved in a property of middleware instance.
I think it would make sense to add documentation, explaining that you should never constructor-inject session
, session.store
, auth
or auth Guard
, and instead use method-injection or access them through Request
instance.
Thx for your feedback! Isuue now can be closed?
Given configuration:
If first request resolves auth, it will be available (resolved) during next request as well, even before
BeforeLoopIterationEvent
is fired.We fixed it by adding
session
andsession.store
toclear_instances
and disabling ResetSessionListener, as those are singletons holding user-related data and should be "forgotten" in container before processing next request.The question is: why isn't this the default? Why does
ResetSessionListener
even exist in the first place? There is alsoUnqueueCookiesListener
, but again, why not just clearcookie
instance?It's not meant to be offensive, I'm just asking in case I missed something :)