Thanks for you reply!
I'm not sure what you wan't to point out.
I already read the description and content of the attempt() and the loginUsingId() function and i do understand the differences.
loginUsingId() is hardcoding the login to a user given by the ID without any check or proof, that the credentials (user and pass) are correct.
attempt() is verify the credentials and if they match, log the user in
The loginUsingId() function is just for debugging and I'm well aware that such code is dangerous and contra-production in production
I was checking where the "authentication gets lost" or if laravel redirects me because of invalid data. therefor i "hardcoded" the login to see if I'm still logged in on the next page.
Since my welcome page just renders a template, Route::view('/', 'welcome')->name('home'); I put the login-code {{ Auth::loginUsingId(1) }} directly into the template.
Afterwards i checked if this also works when putting the login into a controller
To me it looks like, when the Controller Code is running, the session or authentication stuff is not ready
To further troubleshoot this or make sure session are working i have a simple controller
public function show()
{
session([time() => 'key_' . rand(1, 999)]);
return view('ansible.list', [
'playbooks' => $this->playbooks,
'sess'=> session()->all()
]);
}
and inside the template i just {{ print_r($sess) }} the whole session data.
there I do see different key_nnn entries and the whole history. so sessions are working