Skip to content

BUG: Using EP on same domain, but over different protocols causes "Warning: it appears that your browser does not have cookies enabled. " #3179

@tiblu

Description

@tiblu

image

Reproduce

  • Access EP instance over HTTPS
  • Access EP instance over HTTP on the same domain

Result

  • Alert:

Warning: it appears that your browser does not have cookies enabled. EtherPad uses cookies to keep track of unique users for the purpose of putting a quota on the number of active users. Using EtherPad without cookies may fill up your server's user quota faster than expected.

  • Etherpad renders fine, but prefs are lost.

Expected

  • No error

Root cause

  • When visiting over HTTPS prefs=..;secure cookie is set.
  • When visiting over HTTP, EP tries to write prefs= NON secure cookie, but fails cause browser denies overwriting secure cookie with the same name. Thus error is displayed.

Introduced by

Solution

I know this probably does not bother a lot of people as HTTPS should be the standard protocol and never use over HTTP. For us it only causes problems in testing environments. If we talk about solutions only idea I have is:

  • To have differently named cookies for HTTPS and HTTP.
    • HTTPS - prefsSecure (or whatever)
    • HTTP - prefs

The shortcoming of this solution is that prefs are different for HTTP and HTTPS depending which User opens. But taking into account, that prefs are lost anyway for this bug, it's OK.

I will PR this if people find this solution OK.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions