Neeraj1005's avatar

Login page: 419 Page Expired in Google Chrome

In my Laravel8.x project, I'm facing an issue. can anyone tells me what is happing basically and what should I have to do?

Basically, If I run my project in Google chrome and try to log in it takes too much time and sends me a page expire 419 error. But If I run my project in *Mozilla or Microsoft Edges browser the login system run smoothly no error page occurs. I'm confused about what is going on and what I did wrong.

0 likes
16 replies
Neeraj1005's avatar

@michaloravec

   /*
    |--------------------------------------------------------------------------
    | Same-Site Cookies
    |--------------------------------------------------------------------------
    |
    | This option determines how your cookies behave when cross-site requests
    | take place, and can be used to mitigate CSRF attacks. By default, we
    | will set this value to "lax" since this is a secure default value.
    |
    | Supported: "lax", "strict", "none", null
    |
    */

    'same_site' => 'lax',

nothing is changed.. in same_site. I do not understand why it take too much time in chrome. In other browser login system works properly... Basically for authentication, I'm using the laravel-ui

Neeraj1005's avatar

@michaloravec now login is not working. Only page refreshed if I put the credentials and hit the login button only page is refreshed

jlrdw's avatar

Okay that is weird I am having no trouble in Chrome. Have you modified anything. Meanwhile keep your site safe. I have not had to mess with any settings to get it working in Chrome.

Edit:

I even updated chrome to latest, I logged in local development, and online.

I then logged into here (laracast), all worked well. I am guessing Jeffrey is on version 8.

So I am wondering if you had modified something in Authentication that would cause a problem with chrome?

quangggg's avatar

Try to change 'secure' => env('SESSION_SECURE_COOKIE', false) in session.php

Or

Change $this->secure = false (hard-coded) in __contruct func in Cookie.php " your_project\vendor\symfony\http-foundation" (For test)

Clear cache and config.

Check your dev tools/application tab, Were the sessions/caches of laravel stored?

Hope this helps :D

jlrdw's avatar

@rodrigo.pedra yes it's not laravel, see my reply above, I have had no problems with Chrome.

In fact I tried all sorts of stuff to make it "mess up", refreshing, back, hit enter, etc.

1 like
rodrigo.pedra's avatar

Thanks for the heads up @jlrdw

Just stumbled upon this thread and remembered the discussion over GitHub board and thought it might be a good idea to share so it might help somehow.

rodrigo.pedra's avatar

Sure, since I first saw that discussion on GitHub I tried everything to duplicate and also couldn't.

Have apps in Laravel 8, Laravel 7 (migrating last one this week) and Laravel 6 (can't migrate this one on the short term...) and never faced that issue.

But I only use Chrome for Gmail and testing in Chrome when needed. For daily use and development I use Firefox, so my Chrome install has no extensions or any kind of plugin/modification.

So maybe it is a extension-related problem, I don't know.

Neeraj1005's avatar

@jlrdw

did you figure out anything on this issue yet?

Still same issue...in chrome I checked my all authentication file and other but not works...

Some people on the discussions section on Laravel's Github repository are saying it can be related to installed extensions in Google Chrome.

@rodrigo.pedra Maybe It could be the problem of extension...because in my chrome browser I have installed lots of extensions.

Neeraj1005's avatar

@jlrdw @rodrigo.pedra Thank you very much I found it. It is an extension problem... I tried and open new guest chrome where there is no extension installed. And RUn the project and no issue occurs.

Note: Extension causes the issue..... Now I've to figure out which extension is responsible for this :)

hnakama's avatar

I had the same issue, but disabling plugins didn't work. What worked for me was as follows:

Open Chrome, type chrome://flags in the address bar, then press “Enter“. Find "Cookies without SameSite must be secure" and disable it. Click "Refresh" button at the bottom.

There are a lot of secure measures in this page. You may want to tweak other flags for your cases. I suggest you to put them back to "Default" when you go back to normal browsing after work.

Please or to participate in this conversation.