Look up into the code of Login. Maybe you have been put some code to auto log out.
I think that the problem you put your code into global.php. It involked before auth involked.
The Laravel portal for problem solving, knowledge sharing and community building.
The community