diff --git a/dictionaries/consent.php b/dictionaries/consent.php
index 8ae5c40bb621cd476ba740240ff642ca76727bb5..a034f30caefefab1218fbe981f29ff64fe075c59 100644
--- a/dictionaries/consent.php
+++ b/dictionaries/consent.php
@@ -189,6 +189,9 @@ $lang = array(
 		'hr' => 'Niste dali pristanak da se vaši podaci isporuče davatelju usluge.',
 		'hu' => 'Nem adta belegyezését, ahoz hogy adatait kiszlgálatassuk a szolgáltató felé.',
 	),
+	'noconsent_return' => array (
+		'en' => 'Return to consent page',
+	),
 
 );
 
diff --git a/templates/default/consent.php b/templates/default/consent.php
index 566b85db5a92ca7392d778983c3b886c918eaab7..47a8697144814b3e1bb5aa5d6a1c3e6416a01f45 100644
--- a/templates/default/consent.php
+++ b/templates/default/consent.php
@@ -28,9 +28,10 @@
 		</form>
 		<form style="display: inline; margin-left: .5em;" action="<?php echo htmlspecialchars($this->data['noconsent']); ?>" method="GET">
 <?php
-if(array_key_exists('sptype', $this->data) && array_key_exists('spentityid', $this->data)) {
-	echo('<input type="hidden" name="sptype" value="' . htmlspecialchars($this->data['sptype']) . '" />');
-	echo('<input type="hidden" name="spentityid" value="' . htmlspecialchars($this->data['spentityid']) . '" />');
+if(array_key_exists('noconsent_data', $this->data)) {
+	foreach($this->data['noconsent_data'] as $name => $value) {
+		echo('<input type="hidden" name="' . htmlspecialchars($name) . '" value="' . htmlspecialchars($value) . '" />');
+	}
 }
 ?>
 			<input type="submit" id="nobutton" value="<?php echo htmlspecialchars($this->t('no')) ?>" />
diff --git a/templates/default/noconsent.php b/templates/default/noconsent.php
index 40e4f5e166cbf61dde7ab9d14a424f8aa7fcbc49..0442ab7b5602d5073cefe3a8daeb7958eb593989 100644
--- a/templates/default/noconsent.php
+++ b/templates/default/noconsent.php
@@ -10,4 +10,12 @@
 	<h2><?php echo($this->data['header']); ?></h2>
 	<p><?php echo($this->t('{consent:noconsent_text}')); ?></p>
 
+<?php
+	if($this->data['resumeFrom']) {
+		echo('<p><a href="' . htmlspecialchars($this->data['resumeFrom']) . '">');
+		echo($this->t('{consent:noconsent_return}'));
+		echo('</a></p>');
+	}
+?>
+
 <?php $this->includeAtTemplateBase('includes/footer.php'); ?>
\ No newline at end of file
diff --git a/www/noconsent.php b/www/noconsent.php
index 6d6e0a8b525ff6a57f2550bba83180fcdf3ee29d..adc28dcb52677cc2fae381fb1599da77b1b12817 100644
--- a/www/noconsent.php
+++ b/www/noconsent.php
@@ -14,6 +14,9 @@ $session = SimpleSAML_Session::getInstance();
 
 $t = new SimpleSAML_XHTML_Template($config, 'noconsent.php');
 $t->data['spmetadata'] = $spmetadata;
+if(array_key_exists('resumeFrom', $_REQUEST)) {
+	$t->data['resumeFrom'] = $_REQUEST['resumeFrom'];
+}
 $t->show();
 
 ?>
\ No newline at end of file
diff --git a/www/saml2/idp/SSOService.php b/www/saml2/idp/SSOService.php
index 7bed4754ce579f001222d2a8f4594e23d1193bbd..7f024c75e8c0b4a0f53df1a9ae566b567762589f 100644
--- a/www/saml2/idp/SSOService.php
+++ b/www/saml2/idp/SSOService.php
@@ -276,7 +276,6 @@ if($needAuth && !$isPassive) {
 				$t->data['header'] = 'Consent';
 				$t->data['sp_name'] = $sp_name;
 				$t->data['idp_name'] = (isset($idpmetadata['name']) ? $idpmetadata['name'] : $idpentityid);
-				$t->data['sptype'] = 'saml20-sp-remote';
 				$t->data['spentityid'] = $spentityid;
 				$t->data['spmetadata'] = $spmetadata;
 				$t->data['attributes'] = $filteredattributes;
@@ -285,6 +284,11 @@ if($needAuth && !$isPassive) {
 				$t->data['consent_cookie'] = $requestcache['ConsentCookie'];
 				$t->data['usestorage'] = $consent->useStorage();
 				$t->data['noconsent'] = '/' . $config->getBaseURL() . 'noconsent.php';
+				$t->data['noconsent_data'] = array(
+					'sptype' => 'saml20-sp-remote',
+					'spentityid' => $spentityid,
+					'resumeFrom' => SimpleSAML_Utilities::selfURL(),
+					);
 
 				if (array_key_exists('privacypolicy', $spmetadata)) {
 					$privacypolicy = $spmetadata['privacypolicy'];
diff --git a/www/shib13/idp/SSOService.php b/www/shib13/idp/SSOService.php
index 8c2154f7f5399c044d0fbaad2b80e001ee03bbe3..9ae15e0ce1ce5c7056b28aa2ab5ba0df59a6439d 100644
--- a/www/shib13/idp/SSOService.php
+++ b/www/shib13/idp/SSOService.php
@@ -189,7 +189,6 @@ if (!$session->isAuthenticated($authority) ) {
 				$t->data['header'] = 'Consent';
 				$t->data['sp_name'] = $sp_name;
 				$t->data['idp_name'] = (isset($idpmetadata['name']) ? $idpmetadata['name'] : $idpentityid);
-				$t->data['sptype'] = 'shib13-sp-remote';
 				$t->data['spentityid'] = $spentityid;
 				$t->data['spmetadata'] = $spmetadata;
 				$t->data['attributes'] = $filteredattributes;
@@ -198,6 +197,11 @@ if (!$session->isAuthenticated($authority) ) {
 				$t->data['consent_cookie'] = $requestcache['ConsentCookie'];
 				$t->data['usestorage'] = $consent->useStorage();
 				$t->data['noconsent'] = '/' . $config->getBaseURL() . 'noconsent.php';
+				$t->data['noconsent_data'] = array(
+					'sptype' => 'shib13-sp-remote',
+					'spentityid' => $spentityid,
+					'resumeFrom' => SimpleSAML_Utilities::selfURL(),
+					);
 
 				if (array_key_exists('privacypolicy', $spmetadata)) {
 					$privacypolicy = $spmetadata['privacypolicy'];