S
S
SimBioT192015-09-03 11:24:07
PHP
SimBioT19, 2015-09-03 11:24:07

How to set cookies for the entire CNC site?

I tried to set cookies using JS and PHP, now the code is as follows:

setcookie("auth", $text, time() + 3600*24*7, "/"); // (в принципе на javascript то же самое)
but there is a problem .
The user is authorized through the form in the header , that is, you can enter from any page of the site. This is the incomprehensible situation. Suppose if a person comes from the site.com /user/1 page, then cookies will not be visible on the site.com main page , but will be set for /user. Moreover, the most mysterious thing is that /user/ is not another directory, but the CNC, the user.php file and index.php lie side by side. How is it that despite the set path "/" the cookie is still one directory higher?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question