Ghost: Make this site private - not working in Chrome and Opera

Issue Summary

Change or delete the row 58: versions/5.54.4/core/frontend/apps/private-blogging/lib/middleware.js

return session({
           name: 'ghost-private',
           maxAge: constants.ONE_MONTH_MS,
           signed: false,
           sameSite: 'lax'     <----- row 58: instead of 'none' or delete row
       })(req, res, next);

Or you can delete the row 58 because sameSite: ‘Lax’ is the default value. You can’t code ‘secure’ within an object - secure: true will not work.

Works now in Chrome and Opera. See https://web.dev/i18n/en/samesite-cookies-explained x (1) Mark cross-site cookies as Secure to allow setting them in cross-site contexts

Steps to Reproduce

See https://forum.ghost.org/t/make-this-site-private-not-working/39938/1

Ghost Version

5.54.4

Node.js Version

v18.15.0

How did you install Ghost?

local, macos

Database type

SQLite3

Browser & OS version

No response

Relevant log / error output

No response

Code of Conduct

  • I agree to be friendly and polite to people in this repository

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 28 (21 by maintainers)

Commits related to this issue

Most upvoted comments

The code being the same does not mean your PR was not merged. In this case it looks like this change ended up possibly breaking something else so it was reverted: #19298

OK so that means it is still a problem. I am running 5.79.6 (released Feb 26) and cannot make the site private because of this bug. What’s the ETA on solving this?

My solution: I change always the code by myself, when I install an update. You have to change only 2 lines. The first time I reported the solution in August 2023. Maybe they will fix the bug sometimes …

Hey guys, any update on this one? I couldn’t access the links behind why the commit was reverted. So not sure on the details or complexity of the bug, is there any progress towards figuring it out? Thanks, and I’m a huge Ghost fan 😊

The pull request still not merged in version 5.82.2: Fixed private mode cookie for local development #17938

Why not?