I've developed a web app, using cookie. If I set a cookie in localhost with php it works, but if I move the project to a domain (app.segresta.it) cookie stop working. I have done a couple of test and I discovered that if I use javascript, cookie are precisely setted.
setcookie("user", id_user);
Localhost are Linux Ubuntu 15.10. Domain is Linux.
You need to use the following syntax:
setcookie("TestCookie", $value, time()+3600, "example.com");
where "example.com" is your domain name or just "/" instead of domain name. It works for me by this way.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.