S
S
Sergey2016-07-06 10:51:18
PHP
Sergey, 2016-07-06 10:51:18

How to clear cookies from a user?

Good day!
Brief background: the other day hosting went down, and the hoster transferred the account with the site (an online store on ModX with the shopkeeper module) to another server. And as a result of this, a personal discount when placing an order, which is somehow tied to cookies, has ceased to be considered. And until these same cookies were cleared in the browser, the discount was not considered.
Hence the question: how can I clear site cookies for a user, or overwrite them with updated values? Directly, as I understand it, they can not be removed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2016-07-06
@x__miller_x

Example #2 Example of deleting a cookie with setcookie()
To delete a cookie, it is enough to specify some time in the past as the expiration date. This will start the browser mechanism to remove expired cookies.
php.net/manual/en/function.setcookie.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question