Problem/Motivation

Setting up a PageRedirect action that executes after a UserLogin can break the sessions (but doesn't always do it). This is also might prevent hook_user_login executions from other modules.
For a similar issue in another module see:

Steps to reproduce

Set up a PageRedirect that gets executed after a UserLogin. Once the business_rules_user_login hook gets executed and the redirect event gets dispatched, the rest of the login hooks won't execute.

Proposed resolution

I don't know what the best solution would be, but adding a listener for kernel response events and loading the url from the PageRedirect is one way to solve this. Then adding an if in business_rules_user_login so PageRedirects won't fire there will prevent it from breaking. Alternatively, adding a condition and replacing/adding the destination query parameter with the URL from PageRedirect might also do the trick instead of the event dispatch.
As a workaround for now the only solution I see is using another module (based on the other issues rules seems to be a good candidate for now).

Remaining tasks

TBD

User interface changes

TBD

API changes

TBD

Data model changes

TBD

Comments

mhavelant created an issue.

freddy rodriguez’s picture

I'm having the same problem in Core 9.2