I'm using the code:
IF (isset($_GET['s']))
{
$sessie = $_GET['s'];
}
ELSE
{
$sessie = 'I';
}
$cookie = 'JaiDje_Page';
setcookie($cookie, $sessie);
$WDpag = $_COOKIE[$cookie];
echo $WDpag."-".$_COOKIE[$cookie]."-".$sessie."<br>";
After a new value for $sessie (menu choise) the strange thing is that the first time the page is loaded, $WDpag and $_COOKIE[$cookie] are giving the old value and $sessie is giving the new value. After a page refresh all three values are the same.
So after making a choise in the menu the following is echos (exampel)
I-I-Z
than after a page refresh (F5)
Z-Z-Z
It seems that the cookie is one step behind the choise in my menu.
What am I doing wrong?