Page Expiration - PHP / CakePHP and Internet Explorer

I have a search box on my site in which the user enters a term and the results are displayed. When they click on one of the results (product), they get to the product page. When they click the back button, they get a warning message: This page has expired.

I am using CakePHP on Apache and have I been informed that I need to change session.cache_control? I tried dragging it to private in htaccess, but it didn't seem to help.

Any help is greatly appreciated.

Cheers d

+3
source share
2 answers

This is not related to CakePHP and sessions. Indeed, the problem arises in all web programming languages.

, - , 5 ?

, , GET, POST, , , .

 header('Cache-Control: max-age=360'); // allows browser to keep for 1 hour

.... , :

 header('Varies: Cookie');

.

+2

Post/Redirect/Get design pattern, . :

function index($searchTerms = null) {
    if (isset($this->data['Model']['search_terms'])) {
        $this->redirect(array($this->data['Model']['search_terms']));
    }
    // your normal code here.
}

URL-, /controller/action/search+terms /controller/action?search_terms=search+terms, (.. $searchTerms ).

0
source

Source: https://habr.com/ru/post/1747180/


All Articles