From c1c2c38995aa44ea3b12865f46a783340a506253 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 12 Jul 2023 20:06:17 +0100 Subject: [PATCH 1/2] Fixed #13256 - Added option to switch to localStorage instead of cookies Signed-off-by: snipe --- .env.example | 1 + config/session.php | 15 +++++++++++++++ .../views/partials/bootstrap-table.blade.php | 1 + 3 files changed, 17 insertions(+) diff --git a/.env.example b/.env.example index fbf5c4cfff..a9563e6321 100644 --- a/.env.example +++ b/.env.example @@ -85,6 +85,7 @@ COOKIE_NAME=snipeit_session COOKIE_DOMAIN=null SECURE_COOKIES=false API_TOKEN_EXPIRATION_YEARS=15 +BS_TABLE_STORAGE=cookieStorage # -------------------------------------------- # OPTIONAL: SECURITY HEADER SETTINGS diff --git a/config/session.php b/config/session.php index 688340c9e2..bf2181aaa8 100644 --- a/config/session.php +++ b/config/session.php @@ -158,4 +158,19 @@ return [ 'secure' => env('SECURE_COOKIES', false), + /* + |-------------------------------------------------------------------------- + | Bootstrap Table Storage Type + |-------------------------------------------------------------------------- + | + | Set the storage that this Bootstrap Table will use. + | Valid options are: + | - cookieStorage + | - localStorage: use this if you have a LOT of custom fields and are getting a REQUEST TOO LARGE error + | - sessionStorage + | + */ + + 'bs_table_storage' => env('BS_TABLE_STORAGE', 'cookieStorage'), + ]; diff --git a/resources/views/partials/bootstrap-table.blade.php b/resources/views/partials/bootstrap-table.blade.php index 473110fbf5..14ce6ba4c2 100644 --- a/resources/views/partials/bootstrap-table.blade.php +++ b/resources/views/partials/bootstrap-table.blade.php @@ -55,6 +55,7 @@ stickyHeaderOffsetY: stickyHeaderOffsetY + 'px', undefinedText: '', iconsPrefix: 'fa', + cookieStorage: '{{ config('session.bs_table_storage') }}', cookie: true, cookieExpire: '2y', mobileResponsive: true, From 5d60a38a0eef0ffc7b0cb3f7f5b1ae86d9768142 Mon Sep 17 00:00:00 2001 From: snipe Date: Wed, 12 Jul 2023 20:08:20 +0100 Subject: [PATCH 2/2] Added comment with link Signed-off-by: snipe --- config/session.php | 1 + 1 file changed, 1 insertion(+) diff --git a/config/session.php b/config/session.php index bf2181aaa8..a47294a8cb 100644 --- a/config/session.php +++ b/config/session.php @@ -169,6 +169,7 @@ return [ | - localStorage: use this if you have a LOT of custom fields and are getting a REQUEST TOO LARGE error | - sessionStorage | + | More info: https://bootstrap-table.com/docs/extensions/cookie/#cookiestorage */ 'bs_table_storage' => env('BS_TABLE_STORAGE', 'cookieStorage'),