I have upgraded from laravel 5.4 to 5.5. Whenever I try to login, it says "The page has expired due to inactivity Please refresh and try again".
I am using {{csrf_field()}} and also tried to clear browsing data but this is still existing.
Can anybody help me to get rid of this issue ?
Related
So we have an application in which we are using laravel and MySQL and we are facing laravel cache issues. For example, suppose if a user submits a form and we redirect back to the page with some value(flash session or any other data) then laravel is redirecting back to a cached page. If we reload the page then it shows the passed values, anything we do whether it is an update, insert or delete we have to reload it manually even though we redirect or reload the pages by code.
I don't know but I have tried to disable laravel cache but it is still not working.
Even i m calling Artisan commands for every request in my middleware:
Artisan::call('cache:clear');
Artisan::call('view:clear');
Artisan::call('route:clear');
But it's still now working.I m feeling helpless now.
Please help me :-(
I need some help. I don't know, what's wrong with my code, yesterday it works fine, but when I'm trying to change the user this is what happened
ERROR
and this is my CODE
I've tried to find the solution on the internet but some of them are saying that I didn't use them
{{csrf_field()}}
as you see on my code, I think I had nothing wrong, please help me :')
With Laravel 5.6 using Blades templates, it's pretty easy.
<form method="POST" action="/profile">
#csrf
...
</form>
It doesn't work, then Refresh the browser cache and now it might work. (When we update our application, a browser may still use old files. If you don’t clear your cache, Old files can access problems when you apply)
For more details open link:- CSRF Protection in Laravel 5.6
I checked your code and i notify there's another hidden field _token with that name in the Captcha control group, Laravel CSRF field also use _token hidden field, i think problem causing is this thing. You can simple change Captcha token field name and try.
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 :)
After upgrading my site to J3.5, users can't login anymore.
They get the "invalid token" error.
I tried myself around 30 times and I also get the error, although I can login to the admin area.
I cleared Joomla cache, browser cache and truncated the #__session table.
But the problem persists.
This is critical! Users are paying to access certain areas of my site.
WHat more do I have to do to enable user login again????
This is not a core issue (our sites upgraded flawlessly) so should be an extension: read the apache error log and find out which is the offending one, rename its folder (i.e. plugins/system/yourstrangeplugin) and the frontend should load again. then go to the backend, disable the plugin, at that point you can restore its folder original name and update it.
in general, the developer will have issued an update by tomorrow if there are incompatibilities she'll know already.
i am using laravel 5.1 authentication on my development server its work fine but on my production server both login and register pages give error The connection was reset, as there is no php/ laravel error not able to figure out where is the problem.
The one cause for this is laravel blade comments. Try to remove blade comments from that pages and check. Other wise try following scenario which I faced.
I am using Ubuntu 14.04 and site suddenly started giving "Connection was reset" and "No data received" error. I was facing issue in whole site.
After digging the issue, I came to following solution:
Add following code into your root .htaccess and issue will be fixed for now
php_flag xcache.cacher Off
php_flag xcache.size 0
php_flag xcache.stat Off
Hope this helps you too.