Copy link to clipboard
Copied
Hi Chaps,
Quick question on this one, I've got a <noscript> tag in my HTML to check to see if Javascipt in enabled, but how do you check to see if cookies are enabled?
Is there HTML code / PHP function, or do you simply try to set a cookie and redirect on failure to read the cookie you just to to set?
Cheers
Do it w/ php by setting a cookie at the beginning of the page then if/else where if cookie isset then show cookie page else show no cookie page.
http://www.w3schools.com/PHP/php_cookies.asp
Copy link to clipboard
Copied
Can be done with JavaScript:
<script type="text/javascript">
document.cookie = "Test=cookie";
if(document.cookie.indexOf("Test") == -1){
alert("Disabled");
} else {
alert("enabled");
}
</script>
Copy link to clipboard
Copied
Do it w/ php by setting a cookie at the beginning of the page then if/else where if cookie isset then show cookie page else show no cookie page.
http://www.w3schools.com/PHP/php_cookies.asp
Find more inspiration, events, and resources on the new Adobe Community
Explore Now