Maybe there is a better way around having to use a cookie. But i want to set in my php something to tell the user an error but only have it come on once, if they refresh the page i do no want it there anymore.
$time = (1000);
setcookie("msgtype", $type, time() + ($time), '/');
setcookie("msg", $message, time() + ($time), '/');
print_r($_COOKIE);
So for some reason, if i output the $_cookie directly after it still won’t display this cookie.
Any ideas?
Instead, when showing the error clear the cookie, rather than having it set for 1 second, so that when it refreshes next time & checks for the cookie it won’t be there and so would not display any error.
Or a better option would be using sessions.