I am trying to view a PHP page with and without using an iframe, but the result is the same regardless of the IF condition using $_SERVER['HTTP_SEC_FETCH_DEST'] to detect that it is in an iframe.
if (isset($_SERVER['HTTP_SEC_FETCH_DEST']) and $_SERVER['HTTP_SEC_FETCH_DEST'] == 'iframe') { // do something }
The result is always true until I manually refresh the page that isn't using the iframe. Any suggestions to make this work? Seems like some kind of buffer issue, but I have not been able to solve it with flush().
Adding a header to revalidate solved my problem.
header('Cache-Control: no-store, no-cache, must-revalidate');
1.4m articles
1.4m replys
5 comments
56.9k users