Skip to content
Snippets Groups Projects
Commit cb4657bb authored by Olav Morken's avatar Olav Morken
Browse files

Session: Change getData to not update the expire-time of data which is accessed.

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@577 44740490-163a-0410-bde0-09ae8108e29a
parent 9bba167f
No related branches found
No related tags found
No related merge requests found
......@@ -527,6 +527,10 @@ class SimpleSAML_Session {
/**
* This function removes expired data from the data store.
*
* Note that this function doesn't mark the session object as dirty. This means that
* if the only change to the session object is that some data has expired, it will not be
* written back to the session store.
*/
private function expireData() {
......@@ -604,6 +608,9 @@ class SimpleSAML_Session {
/**
* This function retrieves data from the data store.
*
* Note that this will not change when the data stored in the data store will expire. If that is required,
* the data should be written back with setData.
*
* @param $type The type of the data. This must match the type used when adding the data.
* @param $id The identifier of the data.
* @return The data of the given type with the given id or NULL if the data doesn't exist in the data store.
......@@ -626,12 +633,7 @@ class SimpleSAML_Session {
return NULL;
}
$dataInfo =& $this->dataStore[$type][$id];
$dataInfo['expires'] = time() + $dataInfo['timeout'];
$this->dirty = TRUE;
return $dataInfo['data'];
return $this->dataStore[$type][$id]['data'];
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment