diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php
index 5d8c19af0e8f7ab7cda1e69b4e9c3a61aed36ecd..cc06defe9f116c43523cef03689af50548aedd36 100644
--- a/lib/SimpleSAML/Session.php
+++ b/lib/SimpleSAML/Session.php
@@ -551,6 +551,7 @@ class SimpleSAML_Session {
 		$this->nameid = null;
 	
 		$this->sp_at_idpsessions = array();	
+		$this->dirty = TRUE;
 	}
 	 
 	/**