A customer opens a product, logs in and lands elsewhere. Does the return URL decide, or Redirect After Login? One universal precedence rule is insufficient. The earlier guide checks the view after login; here we separate Magento’s result, an additional stage and the final address.
Identify Magento’s login result first
In the reference Magento 2.4.8 LoginPost, an existing login_redirect cookie can determine the return when the dashboard option is disabled. That branch clears the cookie and builds a redirect result. Other cases use AccountRedirect, which considers session state and return addresses among other factors. A setting description alone does not describe every extension to this process.
Record entry URL, domain, Store View, Redirect Customer to Account Dashboard after Logging in setting and outcome for a test account. Adobe’s configuration documentation explains the dashboard option. Compare the same login path: the standard form, AJAX popup and external login may use different mechanisms.
Separate group selection from destination-store selection
In reviewed module version 1.0.6, afterExecute can replace the received result if the extension is enabled, the session is logged in and its group belongs to the configured list. It replaces that result with a session-handoff address. For an unmatched group, this plugin leaves the received result in place. That does not establish immunity from changes by other extensions.
The group list is an activation condition, not a “group → arbitrary URL” dictionary. The inspected helper chooses the Store View saved in the customer’s store_id, or the default view if absent. Do not assume automatic preservation of the current language or same product page. The language-switching guide helps check the actual view and product URL separately.
Check cookies and the plugin chain
The intermediate stage does not explicitly forward the original result URL as the return address. The target controller reads the cookie available in the target request and uses Magento’s redirect mechanism. Cookie domain, path and prior clearing matter. Do not assume a source cookie is available on another domain. Session-handoff security needs separate acceptance before using customer accounts.
Inspect merged plugin configuration, not just this module’s sortOrder. Adobe explains around and after execution: an earlier around that does not invoke the rest of the chain can skip subsequent plugins. An installation with additional customer approval or external login may therefore differ from the redirect module alone. Do not resolve this by reordering alone without reviewing the full path.
Prepare a comparison on a test environment
Compare matched and unmatched groups, dashboard Yes/No, a configured return and no return, and a fresh session. Use an empty cart and separately one with a synthetic item. This matters: the handoff controller includes a cart-clearing operation for a target session that is not logged in. Do not promise item preservation without checking the actual deployment.
For each case, record successive domains and paths, HTTP statuses, final view and test-cart state; redact passwords, tokens and sensitive parameters. Withdrawing account approval is a separate access check that a correct URL does not replace. This is a code-based diagnostic plan: we logged in no real customers, generated no handoff tokens and changed no shop carts.
