V
V
Vadim2015-10-30 22:21:53
PHP
Vadim, 2015-10-30 22:21:53

Why can't cookies be deleted or updated?

Hello! There was such situation: there is a basket which is stored in cookie. When adding a product to the cart, the data is sent to the handler, the product parameters are passed to the function as an array key and the quantity of the product as a value. In the cart there is also the ability to change the quantity of goods, then the data is already transferred to another handler, but they call the same function for adding goods already with a new quantity and the same key extracted from the cookie is passed, but the problem is that the cookies are not updated from this handler. If you simply add the same product with a new quantity, then the data is updated successfully, but the same mechanism in another handler does not work for some reason. I tried to display the array immediately after calling the print_r($_COOKIE[key]) function, checked through the firebug console - the array was displayed with a new value, but as soon as the page is refreshed, the old value is returned. I tried to delete - they are not deleted, while it does not give errors. Please help me figure it out! Thanks in advance!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2015-10-30
@J01

www.telerik.com/fiddler

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question