CakePHP no layout on back and forward button

2019-03-06 04:48发布

问题:

We're building a large CMS in CakePHP with a Croogo install incorporated. We've run into an issue recently where the layout is not rendered correctly when users click the back in the browser (or the forward button for that matter).

What you end up with is the view (.ctp) file using the blank layout, so no styles, js, etc. Any input or ideas would be much appreciated. Thank you!

FYI: modern browsers should cache the page request (cache is enabled), so we're looking at the Auth stuff coz it seems like the first thing that would be called for pages (even cached ones), correct? :S

Also: if the browser is left standing for a few mins and then we click back and forward again, the pages render as expected with the correct layout?!? Session timeout?

回答1:

Solved. This issue was being caused by a bit of javascript that was called in an include in the footer of the default layout.

The solution on this thread was the cause of our headache: jQuery .each loop string or object