I also had a problem like this and I've discovered that the session files were locked for writing. So, I don't know if you are running your Laravel via stuff like vagrant or Docker, but I advise you to try to change the rights of the session directory (and files of course) (When you run Laravel in a VM you should change the rights locally and in the VM (like, when you share the files via NFS)
Like this:
chmod -R 777 storage/framework/sessions
chmod -R 777 storage/logs
I know, a 777 permission is the worst disaster that you can ever imagine. But they are handy for troubleshooting.
To be sure that I never forgot this I made a bash script. (Called it lalog, just because I wanted to clear the log files and set permissions)
Note: Make sure that you use this on the session directory. In config/session.php there is a files
key declared with the location. In my case:
<?php
//...........
'files' => storage_path('framework/sessions'),
//...........
Location: /usr/bin/lalog (This is a file, not a directory)
Execute in shell as lalog
#!/bin/bash
rm -rf /home/username/Projects/x/storage/logs/laravel.log
echo "Laravel log removed"
touch /home/username/Projects/x/storage/logs/laravel.log
echo "Laravel log created"
chmod -R 777 /home/username/Projects/x/storage/
echo "CHMOD 777 on Storage dir"
Warning! This will allow write access for everyone, so be carefull with it! Also, maybe there is some usefull information in the log file of Laravel. (be sure to look in that log file before running my bash script)
Also, I know that it's already mentioned. But, be totally sure that you always
@csrf
in your blade fileThe form should be something like this
<form method="POST" action="{{ route('login') }}">
@csrf
.......
</form>