Hi guy!
I create a session for my login area..now I need logout user and destry session.
So I use this function but is wrong because i can't destroy session. Then in thempalte if I insert Logout in that point I can't log in..
function Logout()
{ if((Session::get('registrato', false)) //if my user log in
session_destroy(); // I destroy session
return Director::redirect('http://chimera2:81/m5/home/'); //I return in my homepage
}
and in template:
<?
if (Session::get('registrato') == 1) //user is log in
{
?>
......
<div><a href="$Logout">LOGOUT</a>
<?
}
?>