diff options
author | habeascodice <habeascodice@federated.social> | 2014-11-13 13:30:29 -0800 |
---|---|---|
committer | habeascodice <habeascodice@federated.social> | 2014-11-13 13:30:29 -0800 |
commit | 2dbecf95454993cdf4996d2d65463d7759cd479b (patch) | |
tree | cbef39a4779efed1c0ab3b61a9ff09e37fadb49e /include/session.php | |
parent | bc02b933727da7a000d43d2d7d495f066616dc81 (diff) | |
parent | ac27db22c18ee7a82a52cbadb3efe2760b910499 (diff) | |
download | volse-hubzilla-2dbecf95454993cdf4996d2d65463d7759cd479b.tar.gz volse-hubzilla-2dbecf95454993cdf4996d2d65463d7759cd479b.tar.bz2 volse-hubzilla-2dbecf95454993cdf4996d2d65463d7759cd479b.zip |
Merge branch 'master' of https://github.com/habeascodice/red
Diffstat (limited to 'include/session.php')
-rw-r--r-- | include/session.php | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/include/session.php b/include/session.php index b531688e2..ed4dfdd16 100644 --- a/include/session.php +++ b/include/session.php @@ -60,11 +60,11 @@ function ref_session_write ($id,$data) { if($session_exists) $r = q("UPDATE `session` SET `data` = '%s', `expire` = '%s' - WHERE `sid` = '%s' LIMIT 1", + WHERE `sid` = '%s'", dbesc($data), dbesc($expire), dbesc($id)); else - $r = q("INSERT INTO `session` - SET `sid` = '%s', `expire` = '%s', `data` = '%s'", + $r = q("INSERT INTO `session` (sid, expire, data) values ('%s', '%s', '%s')", + //SET `sid` = '%s', `expire` = '%s', `data` = '%s'", dbesc($id), dbesc($default_expire), dbesc($data)); return true; @@ -84,8 +84,9 @@ function ref_session_destroy ($id) { function ref_session_gc($expire) { q("DELETE FROM session WHERE expire < %d", dbesc(time())); - q("OPTIMIZE TABLE session"); - return true; + if (! get_config('system','innodb')) + db_optimizetable('session'); + return true; } $gc_probability = 50; |