From 7b9470b804c7b8a449b491482bcd8c537f7eb96e Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Sun, 6 Nov 2016 00:52:31 -0400 Subject: [PATCH] misc performance: remove extraneous session write DB query --- include/session.php | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/include/session.php b/include/session.php index 763b05f481..8cce1488b1 100644 --- a/include/session.php +++ b/include/session.php @@ -71,14 +71,9 @@ function ref_session_write($id, $data) { if ($session_exists) { $r = q("UPDATE `session` - SET `data` = '%s' - WHERE `data` != '%s' AND `sid` = '%s'", - dbesc($data), dbesc($data), dbesc($id)); - - $r = q("UPDATE `session` - SET `expire` = '%s' - WHERE `expire` != '%s' AND `sid` = '%s'", - dbesc($expire), dbesc($expire), dbesc($id)); + SET `data` = '%s', `expire` = '%s' + WHERE `sid` = '%s'", + dbesc($data), dbesc($expire), dbesc($id)); } else { $r = q("INSERT INTO `session` SET `sid` = '%s', `expire` = '%s', `data` = '%s'",