Skip to content
This repository was archived by the owner on Nov 27, 2020. It is now read-only.
This repository was archived by the owner on Nov 27, 2020. It is now read-only.

Set a better default for cookie-session name #159

@dsamojlenko

Description

@dsamojlenko

Summary

When setting the cookie-session cookie name, this code in config/cookieSession.config.js can be problematic:
image

The issue can arise when deploying to production, if you haven't set the COOKIE_SECRET environment variable, the app will use a generated name based on timestamp. The problem arises when deploying to a multi-server environment, each server will generate a cookie of a different name, causing issues when users roam across servers.

One solution would be to make it clear in docs that COOKIE_SECRET should always be set in Production, and run a check when in Production mode that will cause the server startup to fail.

Another solution would be to not use a time-based name by default, and just specify something arbitrary (ie, the default name when using cookie-session is session)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions