Skip to content

session_id(): Session ID cannot be changed when a session is active" in requireAuth() with a stale session cookie #2696

Backlog

Description

@erickr

Specifics of your environment

  1. Are you acting as SP/IdP/proxy? SP
  2. SimpleSAMLphp: What version are you using? 2.4.12
  3. PHP: What version are you using? 8.3
  4. Platform: unix or Windows? Linux/Ubuntu
  5. Webserver: Apache/Nginx/ISS? Apache/mod_php

Describe the bug
With store.type = phpsession, new Auth\Simple($source) followed by requireAuth() raises a warning when the browser sends a session cookie whose PHP session holds no SimpleSAML session data (for example, an expired session).

We suspect that this was introduced by the changes in #2685 but arent entirely sure.

We did find a possible workaround to be new Auth\Simple($source, null, Session::getSessionFromRequest()).

To Reproduce
Authenticate and ensure there is a valid session cookie, remove the php session file to provoce the error. Attempt to authenticate again, which should just re-authenticate, but without the workaround gives us an error.

Activity

  1. tvdijen commented on Dec 4, 2026

    @tvdijen
    Member

    That PR #2685 was released in v2.4.13, so that can't be the problem. In fact, it could be the solution! Could you try updating to the latest version to see if you still have this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions