S
S
Sergey Beloventsev2016-05-29 23:46:30
Yii
Sergey Beloventsev, 2016-05-29 23:46:30

How to avoid “Document overdue submission” POST error?

Good afternoon.
Sending data using the POST method sorts the result.
I go from the sorted page to the links, everything is ok!
When I press the "back" button in the browser (Mozilla) issues

Документ просрочен
    Этот документ более не доступен.
    Запрошенный документ не доступен в кэше Firefox.В целях безопасности Firefox не производит автоматический повторный запрос важных документов.Нажмите «Попробовать снова», чтобы повторно запросить документ с веб-сайта.

Chromium
Подтвердите повторную отправку формы
    
    ERR_CACHE_MISS

As I understand it, this is related to POST-REDIRECT-GET. That is, it gives an error 301 or 302, so as not to not perform a POST request, how can I solve this problem in Yii2?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Inishev, 2016-05-29
@inish777

Using POST involves changing the data on the server, so the browser does not store the page in the cache. Are you sure that using POST rather than GET for sorting is justified?

X
xmoonlight, 2016-05-30
@xmoonlight

After POST-processing of all data on the server, do NOT IMMEDIATELY OUTPUT, but redirect to another page for output.
For example, at the end of processing all POST parameters, we write location('/listView.php'); exit;
After that, the browser will be redirected (301) to another page to display the sort results.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question