aboutsummaryrefslogtreecommitdiffstats
path: root/include/session.php
diff options
context:
space:
mode:
authorPaolo T <tuscanhobbit@users.noreply.github.com>2014-11-24 14:19:22 +0100
committerPaolo T <tuscanhobbit@users.noreply.github.com>2014-11-24 14:19:22 +0100
commitbef8879cb1356b880279c6104fcffb0752414a7c (patch)
treece3733df7ca168f4afe7e963dc81b6f00944c34c /include/session.php
parent1cb45c30e9032794b7827738cc28f7728ac28677 (diff)
parent5b7124f0daeca4aa619f6411ee373d9ff5a22b7b (diff)
downloadvolse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.tar.gz
volse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.tar.bz2
volse-hubzilla-bef8879cb1356b880279c6104fcffb0752414a7c.zip
Merge pull request #7 from friendica/master
Merge from main project
Diffstat (limited to 'include/session.php')
-rw-r--r--include/session.php11
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;