Postingan lainnya
Cara agar ketika back di browser tidak kembali kehalaman sebelumnya saat logout
Saya sedang membuat aplikasi tetapi saat sesudah logout ketika di back ke halaman sebelumnya langsung kembali lagi ke dasboard seharusnya tidak bisa harus login terlebih dahulu bagaimana caranya ya? mohon bantuannya....
image.png
Tampilan ketika di back masuk lagi ke halaman dashboard
image.png
LoginController :
{
public function postlogin (Request $request) {
//dd($request->all());
if (Auth::attempt($request->only('username', 'password'))){
return redirect('/Login');
}
return redirect ('Login');
}
public function logout (Request $request) {
Auth::logout();
return redirect('/login');
}
}
Login.blade.php:
<!DOCTYPE html>
<html>
<head>
<title>Trash-in</title>
<link rel="stylesheet" type="text/css" href="{{ asset ('css') }}/style.css">
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css">
</head>
<body>
<div class="container">
<div class="form sign-in-container">
<form action="{{route('postlogin')}}" method="post">
{{ csrf_field() }}
<h1>Sign in</h1>
<div class="social-container">
</div>
<input type="email" placeholder="User Email">
<input type="password" placeholder="Password">
<button>Sign In</button>
</form>
</div>
<div class="overlay-container">
<div class="overlay">
<div class="overlay-panel overlay-right">
<img class="img-profile rounded-circle" width="200" height="200" src="{{ asset('assets') }}/images/smile.png">
</div>
</div>
</div>
</div>
</body>
</html>
2 Jawaban:
<div>cobe cek artikel ini ya<br><a href="https://www.itsolutionstuff.com/post/laravel-5-how-to-prevent-browser-back-button-after-user-logoutexample.html">https://www.itsolutionstuff.com/post/laravel-5-how-to-prevent-browser-back-button-after-user-logoutexample.html</a></div>
<div>Introduction: I like to watch the long railway quietly by myself, and it seems that the twists and <br><a href="https://www.bestvipblog.com/voipphone">virtual phone</a></div>