diff --git a/lib/SimpleSAML/Session.php b/lib/SimpleSAML/Session.php index ce285a2f4321dd84970dcfbe5aeef00a26d3fd0e..c329415aa838b4f96ac6cc50b48a6c4f490f8f16 100644 --- a/lib/SimpleSAML/Session.php +++ b/lib/SimpleSAML/Session.php @@ -838,7 +838,16 @@ class SimpleSAML_Session { $this->dirty = FALSE; $sh = SimpleSAML_SessionHandler::getSessionHandler(); - $sh->saveSession($this); + + try { + $sh->saveSession($this); + } catch (Exception $e) { + if (!($e instanceof SimpleSAML_Error_Exception)) { + $e = new SimpleSAML_Error_UnserializableException($e); + } + SimpleSAML_Logger::error('Unable to save session.'); + $e->logError(); + } }