diff --git a/config/config.ini b/config/config.ini
index edfd977..03067e8 100644
--- a/config/config.ini
+++ b/config/config.ini
@@ -82,6 +82,10 @@ ieGIF = default
; alwaysShowAll = false
alwaysShowAll = default
+; Set to true to automatically refresh the page after the session would
+; have expired.
+automaticRefresh = default
+
; ----------------------------------------------------------------
; These sections are for more esoteric settings - you probably don't
; want to mess with these
diff --git a/lib/templating/kt3template.inc.php b/lib/templating/kt3template.inc.php
index 3ca3f8d..1d5bf2f 100644
--- a/lib/templating/kt3template.inc.php
+++ b/lib/templating/kt3template.inc.php
@@ -284,6 +284,10 @@ class KTPage {
"page" => $this,
"systemversion" => $default->systemVersion,
);
+ $oConfig = KTConfig::getSingleton();
+ if ($oConfig->get("ui/automaticRefresh", false)) {
+ $aTemplateData['refreshTimeout'] = (int)$oConfig->get("session/sessionTimeout") + 3;
+ }
// unlike the rest of KT, we use echo here.
echo $oTemplate->render($aTemplateData);
diff --git a/templates/kt3/standard_page.smarty b/templates/kt3/standard_page.smarty
index 72726fa..ca513bd 100644
--- a/templates/kt3/standard_page.smarty
+++ b/templates/kt3/standard_page.smarty
@@ -12,6 +12,10 @@
+
+{if $refreshTimeout}
+
+{/if}