diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php
index 0249884eeffb4834eb9ecfa305a2e0ed85a9d7b1..b80831289f8a6acae6e6b92b6b7fdac2fa0c8f4c 100644
--- a/lib/SimpleSAML/Session.php
+++ b/lib/SimpleSAML/Session.php
@@ -607,6 +607,31 @@ class SimpleSAML_Session {
 	}
 
 
+	/**
+	 * Delete data from the data store.
+	 *
+	 * This function immediately deletes the data with the given type and id from the data store.
+	 *
+	 * @param string $type  The type of the data.
+	 * @param string $id  The identifier of the data.
+	 */
+	public function deleteData($type, $id) {
+		assert('is_string($type)');
+		assert('is_string($id)');
+
+		if (!is_array($this->dataStore)) {
+			return;
+		}
+
+		if(!array_key_exists($type, $this->dataStore)) {
+			return;
+		}
+
+		unset($this->dataStore[$type][$id]);
+		$this->dirty = TRUE;
+	}
+
+
 	/**
 	 * This function stores data in the data store.
 	 *