in the onAfterInitialise function of Joomla i get the current link which i explode to see the alias of the menu item. If the statement is true i print a name, which gets printed. In the else statement i unset a session variable, which also gets unset. So the if statement is true but still the session variable gets unset. This only occurs when i go to the next page of my list by pagination.
$link = explode("/", str_replace(".html", "", $_SERVER["REQUEST_URI"]));
print_r($link);
if ("producten" == $link[1]){
print_r("working");
}else{
unset($_SESSION["searchfield"]);
}
Result = "working", but when i print the session variable its empty now. Any idea what i'm doing wrong?