D
D
DarkMatter2016-03-13 19:33:41
PHP
DarkMatter, 2016-03-13 19:33:41

Why is the cookie disappearing?

The cookie is placed in the site.ru/ref/N directory where N is $refnum
Everything is fine, the cookie is set and overwritten if a new $refnum value is given in GET
setcookie("ref", $refnum, time()+7776000);
Let's set the path parameter. Cookie is not set.
setcookie("ref", $refnum, time()+7776000, '/');
Let's change the path. The cookie is set, overwritten, but again only on this page! Others have the old one.
setcookie("ref", $refnum, time()+7776000, '../');
When setting the domain, it is again not set at all

setcookie("ref", $refnum, time()+7776000, '../', 'site.ru');

Where is the joint? )))

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dimonchik, 2016-03-13
@dimonchik2013

look through www.telerik.com/fiddler
check with correctly working sites
and in general study the rules of cookies

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question