How can I unset session in PHP , I try to make flash session . I searching some topic that same as my problem and I found try to put exit(); adfter header:location but it didnt work for me
in my Controller
Session::set('add_message', 'added');
return redirect('/list','',array('detail_id'=>$id));
in my redirect function I alredy add exit();
function redirect($as, $parameter=array(), $query_string=array()) {
header('Location: '.route($as, $parameter, $query_string), true, 301);
exit;
}
in my html I try to echo session add_message and unset it but it didnt unset
if ($_SESSION('add_message')) {
echo $_SESSION('add_message');
unset($_SESSION['add_message']);
}