Why are you so focussed on logout and sessions?
what url do they access?
You say they press back and go to xyz.com/home and get 404 but you don't say if /home is a valid Route?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
iam working with a online exam management project.
xyz.com is my application. i have a login form, students, and staff members will login and do their work. everything works fine. But iam facing a problem that, usually student face a 404 error| not found error.
iam not sure when students get these error. what i said to the students is to not clearing the cache, incorrect logout all these gives 404 error. but even they click the back button or refresh also they get this error
this is my route file
Auth::routes();
Route::get('logout', '\App\Http\Controllers\Auth\LoginController@logout');
Route::get('/', 'HomeController@index')->name('home');
this is my session.php
'driver' => env('SESSION_DRIVER', 'file'),
'lifetime' => 35791394,
'expire_on_close' => false,
'encrypt' => false,
'files' => storage_path('framework/sessions'),
'connection' => env('SESSION_CONNECTION', null),
'table' => 'sessions',
'store' => env('SESSION_STORE', null),
say for example xyz.com/ExamPage if for any reason they click back or something the url chage to
xyz.com/home and then it shows a 404 error|not found
student use the application in mobile, so they may not properly logout the application.
what my expectation is whatever the 404 error should not come.
this is homeController
<?php
namespace App\Http\Controllers;
use Session;
class HomeController extends Controller
{
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
/**
* Show the application dashboard.
*
* @return \Illuminate\Contracts\Support\Renderable
*/
public function index()
{
return view('dashboard');
}
}
i dont know where i should change this, and what to do , even 419|page expired error also comes usually. all this is student login only. so i though the improper logout causes this error. is this right??
what i should do to stop this 404 error. kindly some one help
Please or to participate in this conversation.