Skip to content

[Bug]: Session Management: checksession iframe stops after first run #2163

@barosp

Description

@barosp

Version

main, all versions

Please provide a link to a minimal reproduction of the bug

No response

Please provide the exception or error you saw

checksession iframe stops after first run

Steps to reproduce the behavior

- in config set startCheckSession: true
- use session management OpenID Connect, we use OpenIddict server so for example: https://github.com/GREsau/openiddict-session-management-sample/
- register for EventTypes.CheckSessionReceived notification

I notice that it only fires once at app startup and does not perform any polling afterward.

A clear and concise description of what you expected to happen.

I expect the iframe to continuously poll the session state until either the user logs off from the other app or the session ends.

Additional context

I was curious, so I explored the code for the feature and found a condition in check-session.service.ts that is true only once, and then interrupts the recursion:

if (this.lastIFrameRefresh + this.iframeRefreshInterval > Date.now()) {

Additionally, when this condition is true, returning of() stops the Observable in 'pollServerSessionRecur'. I believe that, based on the variable name 'iframeRefreshInterval', the iframe should be refreshed after the default interval of 60 seconds; otherwise, the loop should continue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions