Detecting if the cookies are enabled with PHP ASP or client side java script

For my current project I need a detection if the cookies are enabled or not in the user’s browser.

<?php
[setcookie](http://www.php.net/setcookie)('test', 1, [time](http://www.php.net/time)()+3600);
if(![isset](http://www.php.net/isset)($_GET['cookies'])){
 [header](http://www.php.net/header)('Location:/info.php?cookies=true');
}
if([count](http://www.php.net/count)($_COOKIE) > 0){
 echo "Cookies are yummy!";
} else {
 echo "You didn't bring any cookies here. We are hungry!";
}
?>

Javascript

<script>
function cookieFunction() {
  var x = "Cookies enabled: " + navigator.cookieEnabled;
 alert (x);
}
</script>

I can use this codes but wappler team can integrate server side / client side visual solution . ?
if entagration is easy please add for us
@George or @patrick

I think there’s a simpler solution, using the Browser component:
{{browser1.cookieEnabled}} returns true if cookies are enabled.

3 Likes

thank you @TomD