config: add option for customizing session cookie name.

Fixes getting logged out when you visited Testbooru because of
Testbooru's session cookies clobbering Danbooru's session cookies.
This commit is contained in:
evazion
2020-12-21 19:16:44 -06:00
parent 6c99bbbf47
commit 906430b983
2 changed files with 15 additions and 1 deletions

View File

@@ -1,3 +1,11 @@
# Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cookie_store, key: '_danbooru2_session', domain: :all, tld_length: 2, same_site: :lax, secure: Rails.env.production?
# https://api.rubyonrails.org/classes/ActionDispatch/Cookies.html
Rails.application.config.session_store(
:cookie_store,
key: Danbooru.config.session_cookie_name,
domain: :all,
tld_length: 2,
same_site: :lax,
secure: Rails.env.production?
)