View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005000 | SOGo | GUI | public | 2020-04-02 12:59 | 2020-04-10 12:40 |
Reporter | harmvdwal | Assigned To | |||
Priority | high | Severity | major | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | 4.3.0 | ||||
Summary | 0005000: 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 |
| ||||
Additional Information | I made a patch which checks if a user is logged in and if the page is loaded from cache. | ||||
Tags | No tags attached. | ||||
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(); + } + }; +})(); |
|
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(); + } + }; +})(); |
|