I have a cookie that is filled when I visit the site:

setcookie("request", "true", time()+3600*87760); 

How can I make cookies work for specific pages? Ie if I went to site.com/page1, I signed up and act on this page, but not the rest, and so on with all the pages - in general, I make a div on each page only on the first visit. Is it possible to implement this through a cookie by url?

  • one
    php.net/manual/ru/… ...... fourth parameter ....... path - Путь к директории на сервере, из которой будут доступны cookie. Если задать '/', cookie будут доступны во всем домене domain. Если задать '/foo/', cookie будут доступны только из директории /foo/ и всех ее поддиректорий (например, /foo/bar/) домена domain. По умолчанию значением является текущая директория, в которой cookie устанавливается. path - Путь к директории на сервере, из которой будут доступны cookie. Если задать '/', cookie будут доступны во всем домене domain. Если задать '/foo/', cookie будут доступны только из директории /foo/ и всех ее поддиректорий (например, /foo/bar/) домена domain. По умолчанию значением является текущая директория, в которой cookie устанавливается. - Alexey Shimansky
  • @ Alexey Shimansky, and if you need a page for exactly the get parameter? - Sdafs Fasafs
  • You can use the example: stackoverflow.com/a/9369974/6104996 - Alexey Shimansky
  • one
    Then name the cook differently. COOCIE_FOR_GET_BLA_BLA_BLA. Only what for, if there is a get - Sergey

0