]> git.mxchange.org Git - friendica.git/commitdiff
misc performance: restore session write condition, keep 1 query
authorHypolite Petovan <ben.lort@gmail.com>
Sun, 6 Nov 2016 05:00:17 +0000 (01:00 -0400)
committerHypolite Petovan <ben.lort@gmail.com>
Sun, 6 Nov 2016 05:00:17 +0000 (01:00 -0400)
include/session.php

index 8cce1488b19e960ac999e332597c359ff051f61f..8a1a3c55de4a96027e9169766a429e07100106cf 100644 (file)
@@ -72,8 +72,9 @@ function ref_session_write($id, $data) {
        if ($session_exists) {
                $r = q("UPDATE `session`
                                SET `data` = '%s', `expire` = '%s'
-                               WHERE `sid` = '%s'",
-                               dbesc($data), dbesc($expire), dbesc($id));
+                               WHERE `sid` = '%s'
+                               AND (`data` != '%s' OR `expire` != '%s'",
+                               dbesc($data), dbesc($expire), dbesc($id), dbesc($data), dbesc($expire));
        } else {
                $r = q("INSERT INTO `session`
                                SET `sid` = '%s', `expire` = '%s', `data` = '%s'",