I am doing a login system in php and trying to authorize with JWT
. I am not using any library, I made a class called Jwt
that I pass the pars and it generates the Token and also passes the token and returns me an object with the information of the payload.
So far the logic of my system looks like this:
Home
In my code I have a / login route that sends the form data to / login / auth and inside / auth I make the query in BD
and if it works out I generate token
My question is:
Home
How to check the token on each request?
Can I save the token on a cookie
?
In each check I will have to query the BD
to check the token ?
If you have already done so in another language you can say, maybe it helps me in logic.