For example:

After filling out the form, the page reloads and an alert appears with the notification that the form has been successfully sent. The alert text is a cookie with text.

$_COOKIE['alert'] = "Ваша заявка успешно отправлена"; 

Question:

How to delete a cookie after the next page reload?

  • withdraw and clean immediately. - exvayn
  • Do not set cookies? After all, their point is to save information between page reloads. Once you need to display the generation of the page. - user207618
  • trying to achieve a result, a one-time notice - verstala

1 answer 1

For one output do not need to use cookies.
For example, after processing the application and its successful placement, we generate the output of a template like "Success, accepted" and ... everything!
The following downloads will not create an application and the engine will not generate this template.

UPD:

On fingers:

 Вы ----> Сервер Обработка заказа Генерация страницы с сообщением "Успех, принято" Вы <---- Код страницы 
  • the fact is that after submitting the form, the page completely reloads and there is a complete data reset from $ _POST and you have to save everything in the cookie - verstala
  • Updated ........ - user207618