Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed #13256 - Added option to switch to localStorage instead of cookies #13302

Merged
merged 2 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
16 changes: 16 additions & 0 deletions config/session.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,4 +158,20 @@

'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
|
| More info: https://bootstrap-table.com/docs/extensions/cookie/#cookiestorage
*/

'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