diff --git a/modules/consentAdmin/templates/consentadmin.php b/modules/consentAdmin/templates/consentadmin.php
index 13829af83594ed964f9596785f4dfa5f57c2f097..ce3386c4c82e28366da238425ffbd96cbac1fcef 100644
--- a/modules/consentAdmin/templates/consentadmin.php
+++ b/modules/consentAdmin/templates/consentadmin.php
@@ -127,6 +127,6 @@ TRSTART;
 
         <h2>Logout</h2>
 
-            <p><a href="<?php echo htmlentities(\SimpleSAML\Utils\HTTP::getSelfURL()) . '?logout'; ?>">Logout</a></p>
+            <p><a href="<?php echo \SimpleSAML\Module::getModuleURL('consentAdmin/consentAdmin.php', array('logout' => 1)); ?>">Logout</a></p>
 
 <?php $this->includeAtTemplateBase('includes/footer.php');