5 Replies - 441 Views - Last Post: 06 January 2020 - 01:57 AM Rate Topic: -----

#1 RobHowdle   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 48
  • Joined: 03-December 19

Laravel 5.8 Issues

Posted 05 December 2019 - 04:21 AM

Hi all,

Wasn't sure if this topic went here or PHP. Does anybody use Laravel? I've taken over a few projects and the previous developer did everything in Laravel. I've got a system and I'm struggling to login to it. I'm getting a 419 | Page Expired error and after doing a bit of research most peoples thoughts point to the CSRF Token either already being defined or simply not working properly. Went through quite a few different fixes but none seem to have worked. Did stuff like generate a new key, change the session driver etc but nothing seems to be working.

Anybody got any suggestions? It would be much appriciated :)

Thanks
Rob

Is This A Good Question/Topic? 0
  • +

Replies To: Laravel 5.8 Issues

#2 xclite   User is offline

  • I wrote you an code
  • member icon


Reputation: 1446
  • View blog
  • Posts: 4,291
  • Joined: 12-May 09

Re: Laravel 5.8 Issues

Posted 05 December 2019 - 09:02 AM

I moved this to the PHP forum.
Was This Post Helpful? 0
  • +
  • -

#3 RobHowdle   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 48
  • Joined: 03-December 19

Re: Laravel 5.8 Issues

Posted 05 December 2019 - 09:51 AM

Apologies for it being in the wrong place, thanks for moving it!

Rob
Was This Post Helpful? 0
  • +
  • -

#4 CTphpnwb   User is offline

  • D.I.C Lover
  • member icon

Reputation: 3826
  • View blog
  • Posts: 13,946
  • Joined: 08-August 08

Re: Laravel 5.8 Issues

Posted 05 December 2019 - 09:44 PM

You're asking a question that requires a specific answer, but giving a vague description of the problem. What, specifically, have you tried? Where is your relevant code sample?
Was This Post Helpful? 0
  • +
  • -

#5 RobHowdle   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 48
  • Joined: 03-December 19

Re: Laravel 5.8 Issues

Posted 06 December 2019 - 03:34 AM

Hi there,

I did post a reply but as soon as I put my code in it told me I was blocked from the forum for some reason. i did put it in the
 brackets too, weird...

The common reason for this error I have found is as follows: "The session expired error message comes up because somewhere your csrf token verification fails which means the App\Http\Middleware\VerifyCsrfToken::class middleware is already turned on. In the form the @csrf blade directive is already added, which should be fine as well."

I'll post my code below but I have tried the following troubleshooting methods:

Generate a new key
Clear Browser Cache, Cleared cache using PHP artisan commands
Adding {{ csrf_field() }} instead of @csrf at the start of the form
Changes session driver to file, cookie, database, redis, array - none of which worked.
Tried Chrome, Edge and Firefox browser
Remove the authentication process - after entering login details and submitted the form it simply redirected me back to an empty login page.

I'll post the code in the next reply encase it doesn't like it blocks me again haha.

Thanks
Rob
Was This Post Helpful? 0
  • +
  • -

#6 RobHowdle   User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 48
  • Joined: 03-December 19

Re: Laravel 5.8 Issues

Posted 06 January 2020 - 01:57 AM

Hi all,

Just as an update, I have fixed this issue, still unsure as to what caused it since I compared the code from the live version to the code from a GitHub repo and they were identical down to the last whitespace but copying the code from the Git seemed to have fixed the issue, how strange!

Rob
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1