up..
Session is not persisting on server
Hi, i'm having a weird bug or issue about persisting sessions,
lets say i manually authenticate the user in HomeController@index using
Auth::attempt(['user' => 'username', 'password' => 'password']);
// or
Auth::login(User::find(1));
but when i navigate to 'HomeController@create' or 'HomeController@edit' the authenticated user is not there. also i tried also setting the controllers middleware to redirect users if not authenticated to 'HomeController@index'.
//HomeController
public function index()
{
Auth::attempt([
'username'=>'username',
'password'=>'password',
]);
}
//OtherController
public function __construct()
{
$this->middleware('auth');
}
in my local machine, it works fine, but when i upload it on the server, it's not working anymore.
i also checked the storage/framework/sessions and the file is there. both local and server.
also tried setting the config/sessions driver to file, database, cookies. but none of these works. i tried clearing the browser's cookie, setting the storage/framework/sessions folder permission to 777, and still no luck. i also tried setting the config/session lifetime to 120 expire_on_close to true, still no luck.
i check
my laravel version is 5.0.35 and php version is 5.4.28, i'm wondering if the php version has something to do with the sessions,
please help.
Please or to participate in this conversation.