PHP – Check whether cookies are cleared – Code explained


Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/vitconsu/public_html/vitoshacademy/wp-content/plugins/php-code-for-posts/PHPPostCode.php on line 544

Warning: sizeof(): Parameter must be an array or an object that implements Countable in /home/vitconsu/public_html/vitoshacademy/wp-content/plugins/php-code-for-posts/PHPPostCode.php on line 78

This site checks whether you have deleted your cookies.
In order to check whether you have deleted successfully your cookies do the following:
1. Delete your cookies.
2. Refresh this website.
If your cookies were deleted, the site will tell you!


Your cookies ARE deleted.

So, how does it work… And what exactly to do?

Roughly, the site checks whether it has left cookies on your PC. If it has left, it gives you a big red NOT.
If the site has found none of its cookies, this may mean 2 things:
a) Your cookies were successfully deleted.
b) This is the first time you visit the site.

How does it work? Here is the code:

What it does is simply to check whether there are cookies. If you want to see the PHP in action, you may do the following, assuming that you are with Google Chrome browser:

1. Press F12;
2. Go to Resources>Cookies;
CookiesPic
3. Select my site;
4. Delete and receive the message “This site has no cookies”.NoCookies
5. Then press F5 and see the message stating “Your cookies are deleted”.

Pretty much, that is it! Enjoy the code! 😀