]> git.mxchange.org Git - friendica.git/commitdiff
ping.php performance: optimizing session_write queries
authorHypolite Petovan <ben.lort@gmail.com>
Fri, 28 Oct 2016 09:55:19 +0000 (05:55 -0400)
committerHypolite Petovan <ben.lort@gmail.com>
Fri, 28 Oct 2016 09:55:19 +0000 (05:55 -0400)
include/session.php

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