php - How can I create a 10-minute valid link in codeigniter?

I make the module I forgot my password for an application. I want to send a link that will be valid for a certain period of time. For example, this link is valid for 10 minutes and then the link will not be valid because the time has expired.
Is there a feature for this in Codeigniter?
Thank you.
Answer
Solution:
No such feature available in Codeigniter and you have to write custom script for the same. There are multiple ways to perform this action:
- You can generate and store token in Database and send that token with forgot password URL. Once user hit forgot password URL, system will validate that token value like whether its exists or not in Database, expiry time etc.
Also you can delete that token once used or set a number of times user can use same token in 10 minutes (For example: If user hit forgot password URL with same time 3 times then system will allow else throw an error).
- Encrypt the timestamp and pass it in forgot password URL
Share solution ↓
Additional Information:
Link To Answer People are also looking for solutions of the problem: closed without sending a request; it was probably just an unused speculative preconnection
Didn't find the answer?
Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.
Similar questions
Find the answer in similar questions on our website.
Write quick answer
Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.