Skip to content

Issue with sessions in pgAdmin4 #6090

Closed

Description

@nikhil-mohite

Please note that security bugs or issues should be reported to [email protected].

Describe the bug
An issue with pgAdmin4 sessions

To Reproduce

Steps to reproduce the behavior:

  1. Install pgAdmin 4 (v6.21) using wheel package (considering all fresh pgAdmin setup)
  2. Create a user ([email protected]) and login
  3. Add new Servers (using import/export servers) and connect with the server
  4. Keep open the browser windows with the [email protected] user logged in
  5. Now uninstall pgAdmin and remove the DB file as well
  6. Now Install pgAdmin 4 v7.0
  7. Create a user ([email protected]) and log in
  8. Add new Servers (using import/export servers)
  9. check the server which was connected with V6.21 is showing as connected even though we have not connected it with the latest installation.

Expected behavior

It should not use the older session with the new login
(Note: use fs_uniquifier from the User model to create a new session)

Desktop (please complete the following information):

  • OS: OSX Ventura
  • Version: Candidate build V7.0
  • Mode: Server
  • Browser (if running in server mode): chrome
  • Package type: Python

Activity

  1. moved this from 🆕 New to 🏗 In Progress in Current Sprint (213)on May 19, 2023
  2. 1 remaining item

  3. moved this from 🏗 In Progress to 🆕 New in Current Sprint (213)on Jun 20, 2023
  4. dpage commented on Aug 19, 2026

    @dpage
    Contributor

    Root cause traced and PR up: #10312. The cached ServerManager for a session is looked up by session id + numeric server id only, so if the configuration database is reset/restored without restarting pgAdmin, a newly created server can inherit a deleted one's id and get served its stale, still-cached connection manager. The fix compares the manager against the current server row's identifying fields before reusing it.

  5. dpage commented on Oct 13, 2026

    @dpage
    Contributor

    Fixed by #10312 (3d5661e).

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

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions