# Be sure to restart your server when you modify this file.

Rails.application.config.session_store :cookie_store, key: '_whitehall_session',
                                                           secure: !(Rails.env.test? || Rails.env.development?)

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# Rails.application.config.session_store :active_record_store

# Be sure to restart your server when you modify this file.

Rails.application.config.session_store :cookie_store, key: '_whitehall_session',
                                                      secure: !(Rails.env.test? || Rails.env.development? || ENV['DISABLE_SECURE_COOKIES'])

# Use the database for sessions instead of the cookie-based default,
# which shouldn't be used to store highly confidential information
# (create the session table with "rails generate session_migration")
# Rails.application.config.session_store :active_record_store

Allow the disabling secure cookies in Rails production environment
Allow the disabling secure cookies in Rails production environment

The publishing end to end tests run Whitehall in Rails production
mode so we can mimic how the app will behave in production as closely
as possible.

We haven't set up HTTPS however which means that the secure cookie
marker is preventing the browser from storing the cookie, and
therefore sessions aren't working properly.

This ENV config allows us to run the app in Rails production mode
from end to end tests.
