Discussion: PHP MVC - Can't delete cookie
In the previous quiz, Online PHP Quiz, we tested our experience gained from the course.
2 messages from 2 displayed.
//= Settings::TRACKING_CODE_B ?> //= Settings::TRACKING_CODE ?>
In the previous quiz, Online PHP Quiz, we tested our experience gained from the course.
If you're not on local server, the problem can be your website is using
pretty urls so you have to specify other parameters of the
setcookie()
method like this:
setcookie('logged', 'true', time() + 3600, '/', '.yourdomain.com', null, true);
Also notice specifying the last parameter to protect the cookies from being stolen using XSS attack.
However, I think you want to use sessions, we don't usually use cookies for logging in/out. Cookies can be used for permanent login, but not for the core mechanism.
2 messages from 2 displayed.