diff --git a/webapp/config/index.js b/webapp/config/index.js index ccc30da73..8aa5b157a 100644 --- a/webapp/config/index.js +++ b/webapp/config/index.js @@ -28,6 +28,9 @@ const sentry = { const options = { VERSION: process.env.VERSION || pkg.version, DESCRIPTION: process.env.DESCRIPTION || pkg.description, + // Cookies + COOKIE_EXPIRE_TIME: process.env.COOKIE_EXPIRE_TIME || 730, // Two years by default + COOKIE_HTTPS_ONLY: process.env.COOKIE_HTTPS_ONLY || process.env.NODE_ENV === 'production', // ensure true in production if not set explicitly } const CONFIG = { diff --git a/webapp/nuxt.config.js b/webapp/nuxt.config.js index 912710ad8..d6ac6a3f0 100644 --- a/webapp/nuxt.config.js +++ b/webapp/nuxt.config.js @@ -191,7 +191,13 @@ export default { apollo: { tokenName: metadata.COOKIE_NAME, // optional, default: apollo-token cookieAttributes: { - expires: 1, // optional, default: 7 (days) + expires: CONFIG.COOKIE_EXPIRE_TIME, // optional, default: 7 (days) + /** * Define the path where the cookie is available. Defaults to '/' */ + // For some reason this can vary - lets see if setting this helps. + path: '/', // optional + /** * A Boolean indicating if the cookie transmission requires a + * secure protocol (https). Defaults to false. */ + secure: CONFIG.COOKIE_HTTPS_ONLY, }, // includeNodeModules: true, // optional, default: false (this includes graphql-tag for node_modules folder)