Project

General

Profile

Bug #34964 » 34964_4-5.diff

Steffen Müller, 2012-03-17 15:52

View differences:

typo3/sysext/cms/tslib/class.tslib_feuserauth.php
}
if ($this->sesData_change) {
if ($this->id) {
$insertFields = array (
'hash' => $this->id,
'content' => serialize($this->sesData),
'tstamp' => $GLOBALS['EXEC_TIME'],
);
$this->removeSessionData();
$GLOBALS['TYPO3_DB']->exec_INSERTquery('fe_session_data', $insertFields);
if (!empty($this->sesData)) {
$insertFields = array (
'hash' => $this->id,
'content' => serialize($this->sesData),
'tstamp' => $GLOBALS['EXEC_TIME'],
);
$GLOBALS['TYPO3_DB']->exec_INSERTquery('fe_session_data', $insertFields);
}
}
}
}
......
* Notice: Simply calling this function will not save the data to the database! The actual saving is done in storeSessionData() which is called as some of the last things in index_ts.php. So if you exit before this point, nothing gets saved of course! And the solution is to call $GLOBALS['TSFE']->storeSessionData(); before you exit.
*
* @param string Session data type; Either "user" (persistent, bound to fe_users profile) or "ses" (temporary, bound to current session cookie)
* @param string Key from the data array to store incoming data in; The session data (in either case) is an array ($this->uc / $this->sesData) and this value determines in which key the $data value will be stored.
* @param string Key from the data array to store incoming data in; The session data (in either case) is an array ($this->uc / $this->sesData) and this value determines in which key the $data value will be stored. If data is NULL, the key is removed
* @param mixed The data value to store in $key
* @return void
* @see setKey(), storeSessionData(), record_registration()
*/
function setKey($type,$key,$data) {
if ($key) {
switch($type) {
function setKey($type, $key, $data) {
if ($key) {
switch($type) {
case 'user':
if ($this->user['uid']) {
$this->uc[$key]=$data;
$this->userData_change=1;
if ($data === NULL) {
unset($this->uc[$key]);
} else {
$this->uc[$key] = $data;
}
$this->userData_change = 1;
}
break;
case 'ses':
$this->sesData[$key]=$data;
$this->sesData_change=1;
if ($data === NULL) {
unset($this->sesData[$key]);
} else {
$this->sesData[$key] = $data;
}
$this->sesData_change = 1;
break;
}
}
(1-1/2)