diff --git a/include/auth.inc.php b/include/auth.inc.php
index 5e83f8af..85f70d5b 100644
--- a/include/auth.inc.php
+++ b/include/auth.inc.php
@@ -33,6 +33,7 @@ if (isset($_POST["server"])) {
unset($_SESSION["passwords"][$_GET["server"]]);
unset($_SESSION["databases"][$_GET["server"]]);
unset($_SESSION["tokens"][$_GET["server"]]);
+ unset($_SESSION["history"][$_GET["server"]]);
redirect(substr($SELF, 0, -1), lang('Logout successful.'));
}
}
diff --git a/include/functions.inc.php b/include/functions.inc.php
index 5f450ab7..e5d55f4d 100644
--- a/include/functions.inc.php
+++ b/include/functions.inc.php
@@ -96,8 +96,8 @@ function query_redirect($query, $location, $message, $redirect = true, $execute
$id = "sql-" . count($_SESSION["messages"]);
$sql = "";
if ($query) {
- $sql = " " . lang('SQL command') . "" . htmlspecialchars($query) . '
' . lang('Edit') . '';
- $_SESSION["history"][] = $query;
+ $sql = " " . lang('SQL command') . "" . htmlspecialchars($query) . '
' . lang('Edit') . '';
+ $_SESSION["history"][$_GET["server"]][$_GET["db"]][] = $query;
}
if ($execute) {
$failed = !$dbh->query($query);
diff --git a/sql.inc.php b/sql.inc.php
index 74454ffc..7096910f 100644
--- a/sql.inc.php
+++ b/sql.inc.php
@@ -67,7 +67,7 @@ if (!$error && $_POST) {
?>