Hello, I’m working on a cookie notification (a small thing that says that by browsing the page you agree with the new cookie’s law blabla) and when someone closes it (it has a close button) it shouldn’t dispaly anymore when the user changes views. I was thinking to do it with a global variable, so when it’s clicked it sets the variable to false and doesn’t display it. But it does show even though I change the variable to false. Here is the piece of code:
<?php
if(!isset(Yii::app()->session['cookiesNotify']))
{?>
<div id="cookies">
<b>you agree with the cooks</a></b>
<button style="margin-top:5px; margin-right:10px;" class="lebutton" onclick="skrijClick()"><b>SKRIJ</b> </button>
</div><!-- cooks -->
<?php } ?>
and here is the javascript onClick function:
function skrijClick()
{
$( "#cookies" ).hide();
<?php set( Yii::app()->session['cookiesNotify']) ; ?>
}
Any suggestions?