Answer the question
In order to leave comments, you need to log in
How to delete cookies when moving to the next page?
Hello, how can I delete cookies when going to the next page?
That is, we went to the site.ru/res?id=1 page and saved the page id (and redirected to the page that was saved in the cookie (in this case, the site.ru/res?id=1 page), that is, when you enter to the site.ru/res page redirects to site.ru/res?id=1)
If, for example, we want to go to the site.ru/res?id=2 page, then it redirects to the site.ru/res?id=1 page like this how she enrolled in cookies.
And you can do that, for example, I went to another page of the site and the cookies were updated with the next page: here is the code
$we = $_GET['page']; // равно 1
setcookie("s34", $we);
if ($_COOKIE["s34"]) {
$cookiepage = $_COOKIE["s34"];
header("Location: site.ru/res?id=$cookiepage");
}
<a href="site.ru/res?id=2"> Статья</a>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question