<?php
namespace wcf\data\session\virtual;
use wcf\data\DatabaseObjectEditor;
+use wcf\system\WCF;
/**
* Provides functions to edit virtual sessions.
'lastActivityTime' => TIME_NOW
));
}
+
+ /**
+ * Deletes the expired virtual sessions.
+ *
+ * @param integer $timestamp
+ */
+ public static function deleteExpiredSessions($timestamp) {
+ $sql = "DELETE FROM ".call_user_func(array(static::$baseClass, 'getDatabaseTableName'))."
+ WHERE lastActivityTime < ?";
+ $statement = WCF::getDB()->prepareStatement($sql);
+ $statement->execute(array($timestamp));
+ }
}
namespace wcf\system\cronjob;
use wcf\data\acp\session\ACPSessionEditor;
use wcf\data\cronjob\Cronjob;
+use wcf\data\session\virtual\SessionVirtualEditor;
use wcf\data\session\SessionEditor;
/**
ACPSessionEditor::deleteExpiredSessions(TIME_NOW - SESSION_TIMEOUT);
SessionEditor::deleteExpiredSessions(TIME_NOW - SESSION_TIMEOUT);
+ SessionVirtualEditor::deleteExpiredSessions(TIME_NOW - SESSION_TIMEOUT);
}
}
$this->virtualSession = null;
if ($this->user->userID && $this->supportsVirtualSessions) {
$virtualSessionAction = new SessionVirtualAction(array(), 'create', array('data' => array('sessionID' => $this->session->sessionID)));
- $this->virtualSession = $virtualSessionAction->executeAction();
+ $returnValues = $virtualSessionAction->executeAction();
+ $this->virtualSession = $returnValues['returnValues'];
}
}
}