I want to create a token based Web API in PHP so as to achieve the following;
A new token should be generated after successful login on the
Login_api.php
page.After authenticating a user in the scenario above, another token should be generated and sent with search query results for all queries submitted on the page at
search_api.php
.Also, in order to get an information from the page at
get_Details_api.php
, the user will send the above regenerated token to authenticate to this API.
Like this every time new token need to be generated to authenticate user, so how should I implement that?
What approach should I use?
How do I validate this new token?
Where should I store this token?