diff --git a/library/includes/page_footer.php b/library/includes/page_footer.php
index c775ac664..cf02bd87c 100644
--- a/library/includes/page_footer.php
+++ b/library/includes/page_footer.php
@@ -61,11 +61,15 @@ if ($show_dbg_info) {
$stat .= " | " . $lang['LIMIT'] . " $l[0] $l[1] $l[2]";
}
- $stat .= ' ] |';
- $stat .= !empty($_COOKIE['sql_log']) ? ' [ wrap · max ] |' : '';
- $stat .= ' |
- |
- ';
+ $stat .= ' ]';
+
+ if (SQL_DEBUG) {
+ $stat .= ' |';
+ $stat .= !empty($_COOKIE['sql_log']) ? ' [ wrap · max ] |' : '';
+ $stat .= ' |
+ |
+ ';
+ }
echo '
' . $stat . '
';
}
diff --git a/src/Legacy/Common/User.php b/src/Legacy/Common/User.php
index 3ad513eba..a0e84679c 100644
--- a/src/Legacy/Common/User.php
+++ b/src/Legacy/Common/User.php
@@ -491,6 +491,15 @@ class User
if ($c_sdata_curr !== $c_sdata_resv) {
bb_setcookie(COOKIE_DATA, $c_sdata_curr, COOKIE_PERSIST, true);
}
+
+ // Unset sql debug cookies
+ if (!SQL_DEBUG || !APP_DEBUG) {
+ foreach (array('explain', 'sql_log', 'sql_log_full') as $cookie) {
+ if (isset($_COOKIE[$cookie])) {
+ bb_setcookie($cookie, '', COOKIE_EXPIRED);
+ }
+ }
+ }
}
}