fix: re-login and re-send when phpMyAdmin expires the session - #13
Merged
Merged
Conversation
blaipr
force-pushed
the
fix/pma-expired-session
branch
from
September 2, 2026 22:07
16a80b3 to
67ab2a5
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
PhpMyAdminClient.runOnechecks each response for the login form (input[name="pma_username"]) before reading it as a result. When it appears, the client clears the session, logs in again and re-sends the statement once; if the login form comes back a second time the statement fails by name (StatementError) instead of being reported as applied.login()now returns the token, and clears stale cookies before starting a new session.docs/phpmyadmin.mdrecords the new selector and the behaviour.Why
phpMyAdmin drops an idle session after 24 minutes by default and answers the next POST with its login page — status 200, no error, no grid, no affected count, and a
tokeninput of its own. An MCP server lives far longer than that, so the firstdb_executeof the afternoon met this page and was reported as applied with nothing affected, and the login form's token was quietly adopted as the rotated one. Nothing ran — an unauthenticated POST is turned away before it reaches MySQL — so the single retry cannot apply a statement twice. Covered by tests over a scriptedfetch; sabotage-checked against the previous client (2 fail).Checklist
npm testpassesnpm run typecheckpassesdocs/updated if behaviour changedCHANGELOG.mdupdated if the change is user-observable