Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Set the Secure flag on Popcode's session token cookie#1587

Open
andy11 wants to merge 3 commits into
popcodeorg:master from
andy11:add-secure-cookie-flag
Open

Set the Secure flag on Popcode's session token cookie #1587
andy11 wants to merge 3 commits into
popcodeorg:master from
andy11:add-secure-cookie-flag

Conversation

@andy11

@andy11 andy11 commented Oct 9, 2018

Copy link
Copy Markdown

Sets the Secure flag to true on the Popcode's session token cookie.

It would be nice to also set the HttpOnly flag, but this is not supported: js-cookie/js-cookie#344.

NOTE: This should not be considered an important security issue, just a minor nit that's probably worth merging eventually :-)

@outoftime outoftime self-requested a review October 10, 2018 23:50
Comment thread src/clients/firebase.js
{expires: new Date(Date.now() + SESSION_TTL_MS)},
{
expires: new Date(Date.now() + SESSION_TTL_MS),
secure: true,

@outoftime outoftime Oct 12, 2018

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andy11 this seems like a reasonable change, but unfortunately it does break behavior in development, where people will typically not be running Popcode over https. So, we should make this behavior configurable, by:

  • Introducing an environment variable e.g. REQUIRE_SECURE_SESSION_COOKIE
  • Passing it through to the client-side code via Webpack (with a default of false)
  • Adding it with value true in our Travis configuration (I will do this once the code is ready)
  • Exposing it as a boolean via the config module

The specific behavior is retaining the user session on refresh—you’ll find that right now, if you log in and then refresh the page with this branch checked out, you’ll be logged back out.

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

Reviewers

@outoftime outoftime outoftime requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /