Php cookies

I have an Issue with a cookie.
I would like to check if it was set so that if it is not I can let a JS run
to tell the user to enable cookies so that the site works properly.
And yes I have to use cookies.

Here is my code:

<!DOCTYPE html>
setcookie(text, test, time() + (86400 * 30));

				  echo "Hater";

Thanks in advance.

Peace out,