V
V
vladimirdereshev2017-04-14 13:37:07
HTTP Cookies
vladimirdereshev, 2017-04-14 13:37:07

How to make it so that when exiting a wordpress site. woocommerce plugin or rather its cart did not save cookies?

When adding products to the cart and exiting the site (an log from the site), the cart still stores data about the products in cookies.
How can I make sure that cookies are automatically deleted after leaving the site (from my account)?
And it turns out I go under 3 different users and the goods in the basket are the same.
Even if a new user is registered, he still has products that he did not add.
Help solve the problem. website www.fotolesson.com

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexander Pushkarev, 2017-04-14
@AXP-dev

Hang a hook on the user's exit

<?php
function your_function() {
    // тут чистим куки
}
add_action('wp_logout', 'your_function');

V
Vasily Nazarov, 2017-04-14
@vnaz

1. You do not need to "clear cookies", but "empty the trash".
2. If you are not a developer, it is better not to try to edit the code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question