From 19fb0ce8aa6492bcd66bbca4790df47cea9c577a Mon Sep 17 00:00:00 2001 From: "Barry vd. Heuvel" Date: Tue, 19 Mar 2024 21:50:30 +0100 Subject: [PATCH] Use localstorage --- src/DebugBar/Resources/debugbar.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/DebugBar/Resources/debugbar.js b/src/DebugBar/Resources/debugbar.js index 998dbf3..56aa384 100644 --- a/src/DebugBar/Resources/debugbar.js +++ b/src/DebugBar/Resources/debugbar.js @@ -1068,8 +1068,8 @@ if (typeof(PhpDebugBar) == 'undefined') { var AjaxHandler = PhpDebugBar.AjaxHandler = function(debugbar, headerName, autoShow) { this.debugbar = debugbar; this.headerName = headerName || 'phpdebugbar'; - if (sessionStorage.getItem('phpdebugbar-ajaxhandler-autoshow') !== null) { - this.autoShow = JSON.parse(sessionStorage.getItem('phpdebugbar-ajaxhandler-autoshow')); + if (localStorage.getItem('phpdebugbar-ajaxhandler-autoshow') !== null) { + this.autoShow = localStorage.getItem('phpdebugbar-ajaxhandler-autoshow') == '1'; } else { this.autoShow = typeof(autoShow) == 'undefined' ? true : autoShow; } @@ -1115,7 +1115,7 @@ if (typeof(PhpDebugBar) == 'undefined') { setAutoShow: function(autoshow) { this.autoShow = autoshow; - sessionStorage.setItem('phpdebugbar-ajaxhandler-autoshow', JSON.stringify(autoshow)); + localStorage.setItem('phpdebugbar-ajaxhandler-autoshow', autoshow ? '1' : '0'); }, /**