Skip to content

Pages: two servers under localhost make each other's pages "out of date" #493

Description

@aitianshi

Priority

P2 · Planned: limited in scope, has a way around it, or a missing feature

Evidence

Two servers under one name on two ports, in one Chromium. As with an SSH tunnel to another machine's Nullius beside one's own.

localhost:8631 and localhost:8632
  cookies                                     session, localhost: one for both
  a write on the first page                   200
  the second server's page opened in a tab
  the same write on the first page            403, X-Nullius-Reason: stale-form-token
  the first page shows                        This page is out of date. Reload it.
  the first page reloaded, the write          200
  a write on the second page                  403, X-Nullius-Reason: stale-form-token

localhost:8631 and 127.0.0.1:8632
  cookies                                     session, localhost; session, 127.0.0.1
  every write on either page                  200

A browser keeps one cookie jar per name, whatever the port. Each server signs session with its own key, so it reads the other's as empty and replaces it.

Way around: open one as localhost, the other as 127.0.0.1.

Reproduction

  1. nullius serve --port 8631, and --port 8632 with another NULLIUS_HOME.
  2. One browser: localhost:8631/settings, then localhost:8632/settings in a second tab.
  3. First tab, any write. From its console:
nulliusFetch('/settings/hosts/test', {method: 'POST', body: new URLSearchParams({entry: 'local', csrf: document.querySelector('input[name=csrf]').value})})

Expected

Each server's pages keep working while the other's are open.

Acceptance

  • A write on one server's page passes after another server's page was opened under the same name
  • A test holds it

Related

#110

Activity

  1. added
    bug
    P2
    on Nov 27, 2026
  2. added theissue type on Nov 27, 2026
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

    P2bug

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions