#TokenMismatchException in VerifyCsrfToken.php line 53

21 messages · Page 1 of 1 (latest)

honest pelican
#

ENVIRINMENT

  • Windows, nginx, PHP7.4, Laravel 5.1, localhost without vHost

INFO

  • Token is included with post request viq VueJS qjqx call
 $.ajax({
                        method: "POST",
                        url: "/"+this.locale+"/modalUserAccount"+ '?_token=' + this.token,
                        data: formData,
                        enctype: 'multipart/form-data',
                        processData: false,  // tell jQuery not to process the data
                        contentType: false,   // tell jQuery not to set contentType
                        async: false,
                        success: function() {
                            that.nextWizard(tabIndex)
                        },
tall radish
#

You're using laravel 5.1 and php 7.4 which are both end of life. Upgrade to supported versions then ask questions

honest pelican
#

I'm doing this in order to upgrade.
1-I pulled code from server.
2- Created the environment locally
3- Tested features (post requests not working CSRF token)
4- next step create a branch 5.2
....
x- upgrade to last version

#

@tall radish upgrade is the goal

tall radish
#

looks like with 5.2 you need to use the header instead of _token

honest pelican
#

I'm still at 5.1.46 lol

tall radish
#

well that docs page is the same in 5.1

honest pelican
#

The issue is not in the code as it is working on the server

#

I think it's then environment. Php.ini? Does it require a domain name?

#

Is it a session issue?

tall radish
#

Well if you're upgrading anyway why dont you change the code to whats in the docs

#

see if it fixes the problem locally

#

and it most likely will also work on the server

honest pelican
#

Testing best practices require all features working on the base version

#

So I can now if something breaks

#

And what commit causes it

tall radish
#

That doesn't apply when your application is 5+ years out of date

honest pelican
#

Logic applies even 1000 years ago? No

#

Well @tall radish thks for trying

#

If you have any creative idea please let me know