* Initializes session variables.
*/
protected function loadVariables() {
- @$this->variables = unserialize($this->session->sessionVariables);
+ @$this->variables = unserialize($this->virtualSession->sessionVariables);
if (!is_array($this->variables)) {
$this->variables = array();
}
$this->session = $session;
// inherit security token
- $variables = @unserialize($this->session->sessionVariables);
+ $variables = @unserialize($this->virtualSession->sessionVariables);
if (is_array($variables) && !empty($variables['__SECURITY_TOKEN'])) {
$this->register('__SECURITY_TOKEN', $variables['__SECURITY_TOKEN']);
}
$data['objectType'] = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->getObjectType();
$data['objectID'] = RequestHandler::getInstance()->getActiveRequest()->getRequestObject()->getObjectID();
}
- if ($this->variablesChanged) {
- $data['sessionVariables'] = serialize($this->variables);
- }
// update session
/** @var \wcf\data\DatabaseObjectEditor $sessionEditor */
$virtualSessionEditor = new SessionVirtualEditor($this->virtualSession);
}
$virtualSessionEditor->updateLastActivityTime();
+
+ $data = [];
+ if ($this->variablesChanged) {
+ $data['sessionVariables'] = serialize($this->variables);
+ }
+ $virtualSessionEditor->update($data);
}
}
parentObjectType VARCHAR(255) NOT NULL DEFAULT '',
parentObjectID INT(10) NOT NULL DEFAULT 0,
objectType VARCHAR(255) NOT NULL DEFAULT '',
- objectID INT(10) NOT NULL DEFAULT 0,
- sessionVariables MEDIUMTEXT
+ objectID INT(10) NOT NULL DEFAULT 0
);
DROP TABLE IF EXISTS wcf1_acp_session_access_log;
ipAddress VARCHAR(39) NOT NULL DEFAULT '',
userAgent VARCHAR(255) NOT NULL DEFAULT '',
lastActivityTime INT(10) NOT NULL DEFAULT 0,
+ sessionVariables MEDIUMTEXT,
UNIQUE KEY (sessionID, ipAddress, userAgent)
);
parentObjectID INT(10) NOT NULL DEFAULT 0,
objectType VARCHAR(255) NOT NULL DEFAULT '',
objectID INT(10) NOT NULL DEFAULT 0,
- sessionVariables MEDIUMTEXT,
spiderID INT(10),
KEY packageID (lastActivityTime, spiderID),
UNIQUE KEY uniqueUserID (userID)
ipAddress VARCHAR(39) NOT NULL DEFAULT '',
userAgent VARCHAR(255) NOT NULL DEFAULT '',
lastActivityTime INT(10) NOT NULL DEFAULT 0,
+ sessionVariables MEDIUMTEXT,
UNIQUE KEY (sessionID, ipAddress, userAgent)
);