Skip to content

[IMPROVEMENT] Auth: Ensure proper session rotation / Impl. `SessionUp… - #12312

Merged
thojou merged 1 commit into
ILIAS-eLearning:trunkfrom
mjansenDatabay:hotix/trunk/session-rotation
Oct 28, 2026
Merged

thojou merged 1 commit into
ILIAS-eLearning:trunkfrom
mjansenDatabay:hotix/trunk/session-rotation

Conversation

@mjansenDatabay

@mjansenDatabay mjansenDatabay commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

…dateTimestampHandlerInterface`

Session ids are now rotated only at the points where the authenticated account changes.

  • Login, logout, and expiry each get their own transition. onLoginSuccess() and onSessionExpired() rotate the id. logout() drops the previous $_SESSION payload, destroys the session, and starts a new anonymous one. ensureAnonymousContext() keeps the current id for the login page and clears the payload only when leaving a logged-in account.
  • A cookie whose id PHP adopted but which has no usr_session row is replaced at bootstrap. A registered cookie session is resumed unchanged.
  • doStandardAuthentication is no longer a safe POST command, so the login POST requires an rtoken (CSRF) after the ctrl-security artifact is rebuilt.
  • WebDAV, account migration, ECS, the calendar remote-access handler, and the Web Access Checker use the new fully-authenticated and anonymous-context checks.
  • ilSessionDBHandler implements SessionUpdateTimestampHandlerInterface. An unchanged session extends its idle deadline without rewriting the stored payload.

Improvement-Request: https://mantis.ilias.de/view.php?id=24216

@mjansenDatabay
mjansenDatabay requested a review from thojou October 28, 2026 12:46
@mjansenDatabay mjansenDatabay added improvement php Pull requests that update Php code labels Oct 28, 2026
@mjansenDatabay
mjansenDatabay force-pushed the hotix/trunk/session-rotation branch 2 times, most recently from 81abb99 to 8a81e03 Compare October 28, 2026 14:09
@mjansenDatabay
mjansenDatabay force-pushed the hotix/trunk/session-rotation branch from 8a81e03 to 9bbd673 Compare October 28, 2026 14:40

@thojou thojou 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.

Hey @mjansenDatabay,

Thanks for the PR.

As we already discussed the details via chat, I'll go ahead and merge this PR now.
I've reviewed and tested the changes – it looks good to me!

Kind regards,
@thojou

@thojou
thojou merged commit cc0ea61 into ILIAS-eLearning:trunk Oct 28, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants