// how to set session in laravel // 1 use IlluminateHttpRequest; use this in web.php // Route::get('set_session', function(Request $request){ // And write this code $request->session()->put('user','jhon'); return redirect('session_get'); });