0
I did a function in the fur codeigniter for password recovery and it’s all working, only I wanted it to expire the link has a x time/day.
What logic to use in this situation?
0
I did a function in the fur codeigniter for password recovery and it’s all working, only I wanted it to expire the link has a x time/day.
What logic to use in this situation?
1
A good solution would be when requesting password recovery:
Having a constant that defines the expiration time;
When the link is accessed:
GET
;If there is a password change, change or remove the token to invalidate the link.
This is a generic and safe way to do it, of course! Not being the only one.
I hope it helped!
More and if I wanted the expiration time to be for example in 2 hours, how would I do? I’m out of ideas here at the moment because tmb never thought to do that.
Include the date and time in the token and compare if the difference of the current date/time with the date/time of the token is less than 2. If so, be it. All ok! If not, please inform that the link is expired.
Browser other questions tagged codeigniter
You are not signed in. Login or sign up in order to post.
Sends in the link a query-string that is an encrypted date that is the deadline. The codeigniter has encryption function.
– user26552