Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable secure cookies over localhost #857

Closed
thegoldgoat opened this issue Dec 22, 2021 · 1 comment
Closed

Enable secure cookies over localhost #857

thegoldgoat opened this issue Dec 22, 2021 · 1 comment

Comments

@thegoldgoat
Copy link

I think it is reasonable to enable secure cookies on localhost, since browsers accepts them.

This simplifies development and avoid developers confusion, since now cookies are suppressed silently.

What I propose is updating isSecure:

function issecure(req, trustProxy) {

And add something like this:

if (req.connection.remoteAddress === '127.0.0.1' ||
    req.connection.remoteAddress === '::ffff:127.0.0.1'
) {
    return true;
}

I am opening a PR in a moment

Also see #837

@dougwilson
Copy link
Contributor

Hello, and thanks for opening this issue. It seems to be a duplicate of #837 though. I can re-open if there is elaboration on how it is not a duplicate, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants