samedi 28 avril 2018

how to completely logout in laravel 5.5 controller?

After I logout of my laravel application, in the browser I press the button to backward (go back) and then I see the dashboard.

I want to eliminate this "session" that laravel mantein if I go back, (btw; when In that dashboard when I click other URL the middleware redirect me to the login view)

can anyone help me?

my route ->

Route::get('auth/logout', 'Auth\LoginController@logout')->name('logout');

my controller ->

<?php

namespace App\Http\Controllers;

use App\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Session;


class LoginController extends Controller
{
    private $user;


    public function logout(){
        Auth::logout();
        \Session::flash('success',"logout");
        return redirect()->route('login');
    }

}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire