I
I
Ibishka2020-08-02 14:38:38
PHP
Ibishka, 2020-08-02 14:38:38

How to make authorization on React and back on php?

The project was divided into 2 separate projects, the first one on react, i.e. only the front, and the 2nd project is a backend on pure php. Communication between them rest api. On the Login page, I send the form to the backend login.php file, where everything is checked against the backend, if everything is good, then the message is true and firstName and lastName user so that instead of the login register buttons, insert the username, but when I refresh the page, I have to make a fetch request to the back to take the data user to understand the person entered the site or false or null if he didn’t enter, but how do you know where to save the data when the user logged in?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton R., 2020-08-02
@anton_reut

where to save data when the user is logged in?

Google Sessions and cookies in php.

I
Ivan, 2020-08-03
@asmodeusta

JWT

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question