Skip to content

Commit

Permalink
Fixed #13256 - Added option to switch to localStorage instead of cookies
Browse files Browse the repository at this point in the history
Signed-off-by: snipe <[email protected]>
  • Loading branch information
snipe committed Jul 12, 2023
1 parent 44231fa commit c1c2c38
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions config/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,19 @@

'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'),

];
1 change: 1 addition & 0 deletions resources/views/partials/bootstrap-table.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ classes: 'table table-responsive table-no-bordered',
stickyHeaderOffsetY: stickyHeaderOffsetY + 'px',
undefinedText: '',
iconsPrefix: 'fa',
cookieStorage: '{{ config('session.bs_table_storage') }}',
cookie: true,
cookieExpire: '2y',
mobileResponsive: true,
Expand Down

0 comments on commit c1c2c38

Please sign in to comment.