From 3fc935d4bbe1f7c00a353bf7d46c3c14d330c532 Mon Sep 17 00:00:00 2001
From: ckleemann <ckleemann@users.noreply.github.com>
Date: Sat, 20 Feb 2021 14:25:28 +0100
Subject: [PATCH] Introduce an env variable for the Session Cookie Path

---
 .env.example.complete  | 1 +
 app/Config/session.php | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/.env.example.complete b/.env.example.complete
index 9b8c8298a..8369e5973 100644
--- a/.env.example.complete
+++ b/.env.example.complete
@@ -73,6 +73,7 @@ SESSION_DRIVER=file
 # Session configuration
 SESSION_LIFETIME=120
 SESSION_COOKIE_NAME=bookstack_session
+SESSION_COOKIE_PATH=/
 SESSION_SECURE_COOKIE=false
 
 # Cache key prefix
diff --git a/app/Config/session.php b/app/Config/session.php
index 571836bd2..84916bcd4 100644
--- a/app/Config/session.php
+++ b/app/Config/session.php
@@ -59,7 +59,7 @@ return [
     // The session cookie path determines the path for which the cookie will
     // be regarded as available. Typically, this will be the root path of
     // your application but you are free to change this when necessary.
-    'path' => '/',
+    'path' => env('SESSION_COOKIE_PATH', '/'),
 
     // Session Cookie Domain
     // Here you may change the domain of the cookie used to identify a session