Voyager first login gives 419 Page Expired error - laravel

I've made a new installation of Voyager on XAMPP on Windows following the instructions at https://github.com/the-control-group/voyager
I forgot to install with dummy data so I added an admin user using php artisan voyager:admin me#mydomain.com --create however when I try to login I get the 419 | Page Expired error which I understand is usually an issue with Laravel sessions.
My versions are: Voyager v1.4 | Laravel v7.18 | PHP v7.3.2 | MySql v5.0.12
The following points maybe relevant:
If I look at the login page source code I don't see any reference to a csrf field.
Looking in the database the user exists in the user table, and I entered an email_verified_at date directly.
I notice there's no entry in the user_roles table. I don't know what minimum database entries are required to make it work.
I've checked that session files are being created in storage/framework/sessions/
There's no error log in storage/logs/
I set 'debug' => env('APP_DEBUG', true), in config/app.php (APP_DEBUG was already set to true in .env) and retried the login but not found any debug log file.
I'm new to Voyager and still learning Laravel. Any ideas please how to make it work please?
UPDATE:
After several refreshes of the login page I was able to login, but if I click any menu link it returns me to the login page.
UPDATE2:
Re-running the install with dummy data succeeded but it didn't alter the login session issue. However it works perfectly on another device, so it must be some kind of browser session issue particular to the one PC.
Incidentally running the install with dummy data did not add any entries in the user_roles table, but the admin role is assigned when viewed in the users screen (on my other device).

I was getting this same error, i was serving my app on 127.0.0.1:8000 and my SESSION_DOMAIN was set on localhost. Make Sure you SESSION_DOMAIN in your env is set to the actual domain the app is being served on. Theissue was fixed by running php artisan serve --port=80 and browing to localhost/admin to login

Related

Laravel 5.2 session lost after successful login, sometimes

When trying to access a protected route or just refreshing the page the session is lost, so I have to login again. What I don't understand is that sometimes this problem does not happen but most of the time it does and sometimes it takes more than 3 times of doing the login before I can finally access a protected route. This only happens in production. I have no idea but it started only after I moved my hosting to Cloudways and users start complaining.I have other Laravel app with version 5.4 on the same server without problems.
1- change your session driver value to database then the user's session will be stored inside your database, sessions table instead of file:
in your .env file set :
SESSION_DRIVER=Database
2- clean cache and config
php artisan config:clear
php artisan cache:clear

Laravel new Sessions on every refresh and 419 when submit login form

I'm working on laravel project which is working correctly in localhost but when I deploy on a subdomain on my server it is facing issues with sessions. I'm using session driver file. When I login, it says 419 your session has expired. It creates a new session file in storage/framework/sessions whenever I refresh that login page. But locally it creates only 1session file browser and log me in and do not show 419. Moreover cookie exist for localhost link in browser but did not created of my domain.
Please help
IN my case, issue was a space before PHP starting tag in routes/api.php
It can also due to space before an PHP starting tag in routes/* files or config/* files
and it can also due to if any of these files have PHP closing tag

Laravel 5.4 : Login and singup working on shared hosting but not on VPS server

I move the project from shared hosting to VPS hosting now everything working fine such as inner pages, design, image loading but I am unable to login and signup now.
When I submit the login/Signup form it will redirect to the same page but without any error message.
And I also generate the Token via command do I need to do anything more to make it work.
I also check the laravel.log file and other things but unable to solve this.
Can anybody face the same issue
Issue is I do not create the session folder to store the session of Laravel 5.4

laravel 5.6 random error "The page has expired due to inactivity"

My Laravel 5.6 project was working well.
But suddenly when I try to login sometimes it says
The page has expired due to inactivity.
and sometimes it login properly with out any error. For example
I go to page 127.0.0.1:8000/login...submit login form and get that error.
I refresh the 127.0.0.1:8000/login page...submit...again error.
I refresh the 127.0.0.1:8000/login page...submit and it works properly :|
Anybody know whats wrong with my project?!
this project works on my host without any problem and I have {{ csrf_field }} in my form.
I've tried to clear cache, view, route, config and deleting browser cache/cookie
and change SESSION_DRIVER=array but still got error.
UPDATE :
another thing that i should say is when it work properly and i login to the panel...when i submit any forms i got out of the panel and i should login again.
for localhost development open kernel.php inside Http folder and just comment this line :
\App\Http\Middleware\VerifyCsrfToken::class,
the csrf protection of laravel doesn't work properly on localhost. I already tried everything. just comment that, it's very annoying problem.
finaly...after 3 bad days focus on this issue...i find the answer and i hope it help someone else :
check your browser setting -> cookies and see how many cookies create
when a user login.
by default laravel create 2 cookies when user login with names :
"XSRF-TOKEN"
"laravel_session"
these are ok but other cookies which you create manually or other installed packages creates cause this problem.
i was using eloquent-viewable package and it creates a cookie everytime i logged in.
i remove this package and then everything works properly :)

Magento backend showing blank pages after login?

I have magento 1.9 version and It is working fine on local and demo server but when I move this to live server its admin is not working.It just login admin and only header and navigation bar shows up there.
I tried with remove cache, sessions.disabled all newly installed extensions.but still same problem.My frontend is working fine.
Please help me to solve this issues.
This error was coming due to some entries in table "adminnotification_inbox" . I don't know why this happened.I just empty this table and my admin works fine but as soon as this table have entry same problem occurs, So After empty that table I disable admin notification from following location:-
System->Advanced->Disable Modules Output
Mage_AdminNotification
This solved my problem.
flush your magento root /var/cache folder and /var/session folders, It may have previous server session that may cause problems.

Resources