Skip to content

Clear, manage and rework feedback data storage in session#1988

Draft
johanib wants to merge 3 commits intomainfrom
feature/EB-1795_clear-sessino
Draft

Clear, manage and rework feedback data storage in session#1988
johanib wants to merge 3 commits intomainfrom
feature/EB-1795_clear-sessino

Conversation

@johanib
Copy link
Copy Markdown
Contributor

@johanib johanib commented Apr 29, 2026

Prior to this change, there were two issues:

  • Feedback info was not cleared on successful login. This caused the debug info from previous successful requests to appear in new requests. For example, the IdP or SP from the previous request would be shown, implying it belonged to the current request.
  • The feedback info was stored at the top level of the session. This means, when having two active requests, data from the first would be merged into the second and/or vice versa.

This change clears the feedback data on successful auth and stores the data separate per request, if possible.

In order to make these changes, the code needed to be refactored. The main issues were:

  • Direct access to $_SESSION. This should be done via the Symfony Session, no longer via the Corto session, which is being phased out.
  • Because of this direct access, there was no central place to manage and encapsulate the feedback info state management. The writes were scattered, making it difficult to trace back how it works. This is now refactored to be the responsibility of the [FeedbackStateHelper](https://github.com/OpenConext/OpenConext-engineblock/compare/feature/EB-1795_clear-sessino?expand=1#diff-1ee213868cf761152d1481e298c752defbcaac60a770ace86f5b9b921f12abf3R24)

Resolves #1795

…1795)

feedbackInfo (the debug context shown on SAML error pages) was stored globally in the session. This caused two bugs:

1. Info from a failed auth flow could bleed into a subsequent unrelated error because storeFeedbackInfo() merged new data on top of old.

2. currentServiceProvider and currentIdentityProvider were never cleared after a successful login, so an early error after a completed auth would still show the SP/IdP from that auth.

These two scenarios are added as failing tests to document the expected behaviour before the fix is in place.
@johanib johanib force-pushed the feature/EB-1795_clear-sessino branch 5 times, most recently from df24b0b to 8ef3dd2 Compare April 30, 2026 13:38
johanib added 2 commits April 30, 2026 16:35
feedbackInfo was stored as a flat dict in $_SESSION['feedbackInfo'] and
merged with existing data on each write. This meant info collected
during one auth flow (e.g. which IdP was involved) could appear on error
pages in a completely separate flow.

Additionally, currentServiceProvider and currentIdentityProvider were
never cleared from the session after a successful login, so they would
show up on error pages for unrelated early errors.

The fix:
- feedbackInfo is now keyed per SAML request ID so each auth flow has
  its own isolated bucket with no merging across flows
- clearFlowContext() is called by ProcessedAssertionConsumer after a
  successful auth, clearing all flow context from the session
- All session access moved from raw $_SESSION to the Symfony session
- Session ops for feedbackInfo and flow context are centralised in a new
  FeedbackStateHelper class, split out from ProcessingStateHelper
- FeedbackStateHelper is wired through DiContainerRuntime instead of the
  legacy DiContainer
Prior to this change, issues in the symfony ci container yaml were not picked up by qa, resulting in runtime errors.
@johanib johanib force-pushed the feature/EB-1795_clear-sessino branch from 8ef3dd2 to b50a07a Compare April 30, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feedbackinfo not cleared after successful login

1 participant