Skip to content

Do not set session files path on CLI context - #21383

Merged
trasher merged 1 commit into
glpi-project:11.0/bugfixesfrom
cedric-anne:11.0/skip-session-path-on-cli
Oct 10, 2025
Merged

trasher merged 1 commit into
glpi-project:11.0/bugfixesfrom
cedric-anne:11.0/skip-session-path-on-cli

Conversation

@cedric-anne

Copy link
Copy Markdown
Member

Checklist before requesting a review

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.

Description

It fixes #21380.

Since #20189, the session is no more started on CLI context. The $_SESSION variable is still used, but its content is not saved anyware and just vanishes at the end of the process execution. Therefore, we do not need to change the sessions files path with session_save_path().

@cedric-anne cedric-anne added this to the 11.0.2 milestone Oct 9, 2025
@cedric-anne cedric-anne self-assigned this Oct 9, 2025
@cedric-anne cedric-anne added the bug label Oct 9, 2025
@cedric-anne cedric-anne mentioned this pull request Oct 9, 2025
2 tasks done

@trasher trasher left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

GLPI core no longer requires session from CLI; but won't that be an issue if a plugin does?

cedric-anne added a commit to pluginsGLPI/databaseinventory that referenced this pull request Oct 9, 2025
@cedric-anne

Copy link
Copy Markdown
Member Author

GLPI core no longer requires session from CLI; but won't that be an issue if a plugin does?

The only occurence of session manual start I found in plugins (except in tests) are pluginsGLPI/databaseinventory#85 and a few legacy migration scripts that are not even compatible with GLPI 11.0 and are probably unmaintained.

Anyway, the result will just be that some files will be created in the default PHP session dir, instead of the GLPI session dir. It should not be an issue.

stonebuzz pushed a commit to pluginsGLPI/databaseinventory that referenced this pull request Oct 10, 2025
* Do not start a session on CRON context

see glpi-project/glpi#21383

* changelog

* Apply suggestion from @Rom1-B

---------

Co-authored-by: Romain B. <8530352+Rom1-B@users.noreply.github.com>
@trasher
trasher merged commit 77f6014 into glpi-project:11.0/bugfixes Oct 10, 2025
10 checks passed
@cedric-anne
cedric-anne deleted the 11.0/skip-session-path-on-cli branch October 10, 2025 13:46
@cedric-anne cedric-anne mentioned this pull request Oct 27, 2025
2 tasks done
@github-actions

Copy link
Copy Markdown
Contributor

This PR has been is closed and has been automatically locked. Please open a new issue with all requested information for related bugs.

@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SessionException for all migrations

2 participants