mercredi 23 décembre 2015

Logout not working in laravel5

It does not destroy the session after logout I able to see the dashboard.How to use Auth mechanism in my View controller

Controller

public function admin_logout()
{
    Session::forget('userid');
    Session::forget('username');
    Session::flush();
    return Redirect('siteadmin');
}

Model

 public static function login_check($uname,$password)
    {
        $check = DB::table('le_admin')->where('adm_email','=',$uname)->where('adm_password','=',$password)->get();
    if($check)
    {
        Session::put('userid', $check[0]->adm_id);
        Session::put('username', $check[0]->adm_email);
        return 1;

    }
    else
    {
        return 0;
    }
}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire