Laravel 7 authentication not persisting
Typical ID10T error on my part. I didn't realize that I had implemented Illuminate\Contracts\Auth\Authenticatable
manually on my model before extending the Illuminate\Foundation\Auth\User
class. PHPStorm had stubbed out those methods for me...
Removing those stubbed methods worked.
laravel auth and session not persisting
Your query seems to be incomplete, from what i understand you are able to get the index page after passing the authentication check only once, and that is by using this method:
public function postLogin() {
$data = array();
$secured = ['user_email' => $_POST['email'], 'password' => $_POST['password']];
if (Auth::attempt($secured, isset($_POST['remember']))) {
if (Auth::user()->user_status == 1 ) {
return Return View::make(user.index);
}
else {
$data['success'] = false;
}
}
else {
$data['success'] = false;
}
return $data;
}
try using a different browser to make sure there is no cookie storage restrictions in the client side and check the app/config/session.php file and see if you have configured the HTTPS Only Cookies according to your needs.
and just on an additional note this line "return Return View::make(user.index);" looks vague.
Laravel 8 - Auth::login() do not save $user data on session
I wanted to do an authentication without any type of database query.
The way I was doing it would not work, because at some point there was still an attempt to go to the database to get the user with that specific identifier.
So, I set out to implement my own Guard, which solved my problem.
For that, I followed this example: Laravel: How to authenticate users without DB, but I adapted to my need
Related Topics
How to Get Date from Excel Using PHPexcel Library
Cannot Start Session Without Errors in PHPmyadmin
PHP Call Class Method/Function
Inet_Aton() and Inet_Ntoa() in PHP
Laravel Error: Method Illuminate\View\View::_Tostring() Must Not Throw an Exception
How to Verify a Tls Smtp Certificate Is Valid in PHP
PHP Domdocument Error Handling
How to Find First Day of the Next Month and Remaining Days Till This Date with PHP
Create PHP Array from MySQL Column
Add Attachment Through PHPmailer
Stream_Socket_Client Unable to Connect (Connection Timed Out)
Line Break Not Working When Writing to Text File in PHP
Laravel 5 Socialite - Curl Error 77: Error Setting Certificate Verify Locations
Does PHP's $_Request Method Have a Security Problem
How to Print Multidimensional Arrays in PHP