php - CSRF about third-party qq login
滿天的星座
滿天的星座 2017-05-27 17:43:43
0
2
727

When I was doing third-party login, I encountered a problem. I wanted to prevent CSRF attacks, and then I added a piece of code like this

Then I am in the callback function. Now I can see that $_GET['state'] can be read, but $state is NULL, and then I wonder if it is not stored. Go in, then I go to write in the first picture and then read. It is worth it at this time.

The error message is an error message thrown by myself in my program, but it is the error here.

Have you encountered this problem? How to solve this problem? I feel like it is a problem with my server configuration? If you are not sure, please ask God for answers.

Screenshot of page throwing error:

滿天的星座
滿天的星座

reply all(2)
迷茫

I have done this before, you can comment out the if judgment. This is one way.

Another way is to take a look at the state generation method. It is a bit like a verification code. You can save the database or session after the state is generated, and then add the state parameters when generating the callback. The value during verification is also the same. Get the database or session to determine the state parameter in the callback.

刘奇

Brother, has anyone encountered this problem?

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template