View Issue Details

IDProjectCategoryView StatusLast Update
0005000SOGoGUIpublic2020-04-10 12:40
Reporterharmvdwal Assigned To 
PriorityhighSeveritymajorReproducibilityalways
Status newResolutionopen 
Product Version4.3.0 
Summary0005000: Back forward cache allows Safari users to see cached pages after logging off.
Description

Safari doesn't properly handle cache after logging off. This is a known issue.

Steps To Reproduce
  1. Open Safari.
  2. Log in to SOGo.
  3. Log off.
  4. Click the back button.
Additional Information

I made a patch which checks if a user is logged in and if the page is loaded from cache.
If the user is nog logged in an the page is loaded from cache it forces a page reload.

TagsNo tags attached.

Activities

harmvdwal

harmvdwal

2020-04-02 12:59

reporter  

prevent-bfcache.patch (1,171 bytes)   
diff -ruN SOGo-4.3.0-orig/UI/Templates/UIxPageFrame.wox SOGo-4.3.0/UI/Templates/UIxPageFrame.wox
--- SOGo-4.3.0-orig/UI/Templates/UIxPageFrame.wox	2020-01-21 16:19:39.000000000 +0100
+++ SOGo-4.3.0/UI/Templates/UIxPageFrame.wox	2020-04-02 14:16:57.000000000 +0200
@@ -35,6 +35,7 @@
         <var:if-ie>
           <link type="text/css" rel="stylesheet" rsrc:href="css/no-animation.css"/>
         </var:if-ie>
+        <script type="text/javascript" src="js/prevent-bfcache.js"><!-- space --></script>
       </head>
 
       <body var:class="bodyClasses" var:ng-app="angularModule" bool:md-no-ink="disableInk">
diff -ruN SOGo-4.3.0-orig/UI/WebServerResources/js/prevent-bfcache.js SOGo-4.3.0/UI/WebServerResources/js/prevent-bfcache.js
--- SOGo-4.3.0-orig/UI/WebServerResources/js/prevent-bfcache.js	1970-01-01 01:00:00.000000000 +0100
+++ SOGo-4.3.0/UI/WebServerResources/js/prevent-bfcache.js	2020-04-02 14:35:36.000000000 +0200
@@ -0,0 +1,10 @@
+/**
+ * Prevent bfcache when logged of.
+ */
+(function () {
+	window.onpageshow = function(event) {
+		if (document.cookie.indexOf('XSRF-TOKEN') == -1 && event.persisted) {
+			window.location.reload();
+		}
+	};
+})();
prevent-bfcache.patch (1,171 bytes)   
harmvdwal

harmvdwal

2020-04-10 12:40

reporter   ~0014273

I had the path to the js file wrong in the original patch. New patch does the trick right.

prevent-bfcache-2.patch (1,200 bytes)   
diff -ruN SOGo-4.3.0-orig/UI/Templates/UIxPageFrame.wox SOGo-4.3.0/UI/Templates/UIxPageFrame.wox
--- SOGo-4.3.0-orig/UI/Templates/UIxPageFrame.wox	2020-01-21 16:19:39.000000000 +0100
+++ SOGo-4.3.0/UI/Templates/UIxPageFrame.wox	2020-04-02 14:16:57.000000000 +0200
@@ -35,6 +35,7 @@
         <var:if-ie>
           <link type="text/css" rel="stylesheet" rsrc:href="css/no-animation.css"/>
         </var:if-ie>
+        <script type="text/javascript" src="/SOGo.woa/WebServerResources/js/prevent-bfcache.js"><!-- space --></script>
       </head>
 
       <body var:class="bodyClasses" var:ng-app="angularModule" bool:md-no-ink="disableInk">
diff -ruN SOGo-4.3.0-orig/UI/WebServerResources/js/prevent-bfcache.js SOGo-4.3.0/UI/WebServerResources/js/prevent-bfcache.js
--- SOGo-4.3.0-orig/UI/WebServerResources/js/prevent-bfcache.js	1970-01-01 01:00:00.000000000 +0100
+++ SOGo-4.3.0/UI/WebServerResources/js/prevent-bfcache.js	2020-04-02 14:35:36.000000000 +0200
@@ -0,0 +1,10 @@
+/**
+ * Prevent bfcache when logged of.
+ */
+(function () {
+	window.onpageshow = function(event) {
+		if (document.cookie.indexOf('XSRF-TOKEN') == -1 && event.persisted) {
+			window.location.reload();
+		}
+	};
+})();
prevent-bfcache-2.patch (1,200 bytes)   

Issue History

Date Modified Username Field Change
2020-04-02 12:59 harmvdwal New Issue
2020-04-02 12:59 harmvdwal File Added: prevent-bfcache.patch
2020-04-10 12:40 harmvdwal File Added: prevent-bfcache-2.patch
2020-04-10 12:40 harmvdwal Note Added: 0014273