ALTER TABLE wcf1_acp_session DROP COLUMN parentObjectID;
ALTER TABLE wcf1_acp_session DROP COLUMN objectType;
ALTER TABLE wcf1_acp_session DROP COLUMN objectID;
-ALTER TABLE wcf1_acp_session DROP COLUMN sessionVariables;
ALTER TABLE wcf1_application DROP COLUMN cookiePath;
ALTER TABLE wcf1_application DROP COLUMN isPrimary;
ALTER TABLE wcf1_session ADD KEY pageID (pageID, pageObjectID);
ALTER TABLE wcf1_session ADD KEY parentPageID (parentPageID, parentPageObjectID);
-ALTER TABLE wcf1_session_virtual ADD sessionVariables MEDIUMTEXT;
-
DROP TABLE IF EXISTS wcf1_sitemap;
ALTER TABLE wcf1_smiley ADD smileyPath2x VARCHAR(255) NOT NULL DEFAULT '';
* @package WoltLabSuite\Core
*/
$data = <<<DATA
-ALTER TABLE wcf1_session DROP COLUMN controller, DROP COLUMN parentObjectType, DROP COLUMN parentObjectID, DROP COLUMN objectType, DROP COLUMN objectID, DROP COLUMN sessionVariables;
+ALTER TABLE wcf1_session DROP COLUMN controller, DROP COLUMN parentObjectType, DROP COLUMN parentObjectID, DROP COLUMN objectType, DROP COLUMN objectID;
ALTER TABLE wcf1_user DROP COLUMN signatureEnableBBCodes, DROP COLUMN signatureEnableSmilies, DROP COLUMN socialNetworkPrivacySettings;
ALTER TABLE wcf1_user_avatar DROP COLUMN cropX, DROP COLUMN cropY;
DATA;
sessionID CHAR(40) NOT NULL,
ipAddress VARCHAR(39) NOT NULL DEFAULT '',
userAgent VARCHAR(191) NOT NULL DEFAULT '',
- lastActivityTime INT(10) NOT NULL DEFAULT 0,
- sessionVariables MEDIUMTEXT,
+ lastActivityTime INT(10) NOT NULL DEFAULT 0
UNIQUE KEY (sessionID, ipAddress, userAgent)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
// create virtual session for current user
-$sql = "INSERT INTO wcf".WCF_N."_acp_session_virtual (sessionID, ipAddress, userAgent, lastActivityTime, sessionVariables) SELECT sessionID, ipAddress, userAgent, lastActivityTime, sessionVariables FROM wcf".WCF_N."_acp_session WHERE sessionID = ?";
+$sql = "INSERT INTO wcf".WCF_N."_acp_session_virtual (sessionID, ipAddress, userAgent, lastActivityTime) SELECT sessionID, ipAddress, userAgent, lastActivityTime FROM wcf".WCF_N."_acp_session WHERE sessionID = ?";
$statement = \wcf\system\WCF::getDB()->prepareStatement($sql);
$statement->execute([WCF::getSession()->sessionID]);
* @property-read integer $lastActivityTime timestamp at which the latest activity occured
* @property-read string $requestURI uri of the latest request
* @property-read string $requestMethod used request method of the latest request (`GET`, `POST`)
+ * @property-read string $sessionVariables serialized array with variables stored on a session-basis
*/
class ACPSession extends DatabaseObject {
/**
* @property-read string $sessionID id of the acp session the virtual acp session belongs to
* @property-read string $ipAddress id of the user whom the virtual acp session belongs to
* @property-read string $userAgent user agent of the user whom the virtual acp session belongs to
- * @property-read integer $lastActivityTime timestamp at which the latest activity occured
- * @property-read string $sessionVariables serialized array with variables stored on a session-basis
+ * @property-read integer $lastActivityTime timestamp at which the latest activity occurred
*/
class ACPSessionVirtual extends DatabaseObject {
/**
* Initializes session variables.
*/
protected function loadVariables() {
- @$this->variables = unserialize($this->virtualSession->sessionVariables);
+ @$this->variables = unserialize($this->session->sessionVariables);
if (!is_array($this->variables)) {
$this->variables = [];
}
$this->session = $session;
// inherit security token
- $variables = @unserialize($this->virtualSession->sessionVariables);
+ $variables = @unserialize($this->session->sessionVariables);
if (is_array($variables) && !empty($variables['__SECURITY_TOKEN'])) {
$this->register('__SECURITY_TOKEN', $variables['__SECURITY_TOKEN']);
}
'requestMethod' => $this->requestMethod,
'lastActivityTime' => TIME_NOW
];
+ if ($this->variablesChanged) {
+ $data['sessionVariables'] = serialize($this->variables);
+ }
if (!class_exists('wcf\system\CLIWCF', false) && !$this->isACP && !$this->disableTracking) {
$pageLocations = PageLocationManager::getInstance()->getLocations();
if (isset($pageLocations[0])) {
else {
$virtualSessionEditor = new SessionVirtualEditor($this->virtualSession);
}
- $virtualSessionEditor->updateLastActivityTime();
- $data = [];
- if ($this->variablesChanged) {
- $data['sessionVariables'] = serialize($this->variables);
- }
- $virtualSessionEditor->update($data);
+ $virtualSessionEditor->updateLastActivityTime();
}
}
userAgent VARCHAR(255) NOT NULL DEFAULT '',
time INT(10) NOT NULL DEFAULT 0,
lastActivityTime INT(10) NOT NULL DEFAULT 0,
+ sessionVariables MEDIUMTEXT,
KEY sessionID (sessionID)
);
ipAddress VARCHAR(39) NOT NULL DEFAULT '',
userAgent VARCHAR(191) NOT NULL DEFAULT '',
lastActivityTime INT(10) NOT NULL DEFAULT 0,
- sessionVariables MEDIUMTEXT,
UNIQUE KEY (sessionID, ipAddress, userAgent)
);
parentPageID INT(10),
parentPageObjectID INT(10),
spiderID INT(10),
+ sessionVariables MEDIUMTEXT,
KEY packageID (lastActivityTime, spiderID),
KEY pageID (pageID, pageObjectID),
KEY parentPageID (parentPageID, parentPageObjectID),
ipAddress VARCHAR(39) NOT NULL DEFAULT '',
userAgent VARCHAR(191) NOT NULL DEFAULT '',
lastActivityTime INT(10) NOT NULL DEFAULT 0,
- sessionVariables MEDIUMTEXT,
UNIQUE KEY (sessionID, ipAddress, userAgent)
);