I want to make a sign up and login system. I have already a sign up page with a verification mail, but I want that the verification link a couple of hours can be clikked. Example if the click on the link about 5 hours than the mail is active, but if the click the mail verification link is clicked about 6 hours that then the email is not activated. How do I do this?
Asked
Active
Viewed 182 times
-3
-
This is way too broad a question and tend to attract answers that may not suit you, or that you will keep commenting as to how it all works and what code(s) you should use. Keep on researching this; the answers to all of your questions exist on the web. – Funk Forty Niner Apr 07 '17 at 12:17
-
4Looks like you need to learn more about what is expected of users here. You are expected to try to **write the code yourself**. After **[doing more research](//meta.stackoverflow.com/questions/261592)** if you have a problem you can **post what you've tried** with a **clear explanation of what isn't working** and providing a [**Minimal, Complete, and Verifiable example**](//stackoverflow.com/help/mcve). I suggest reading [ask] a good question and [the perfect question](http://codeblog.jonskeet.uk/2010/08/29/writing-the-perfect-question/). Also, be sure to take the [tour]. – John Conde Apr 07 '17 at 12:18
2 Answers
1
There are multiple ways you can do this.
The first way is by using a timestamp to determine when the validation key has been issued, and once a user attempts to use it, you check if the current date surpasses the time limit (based on the issue timestamp), and eventually you validate it.
Another way would be using a JWT which has the expiration timestamp in it.

GiamPy
- 3,543
- 3
- 30
- 51
-
1Please don't post answers on obviously off-topic questions! [See: **Should one advise on off topic questions?**](http://meta.stackoverflow.com/q/276572/1768232) Off-topic questions can be closed and deleted, which could nullify your contribution. – John Conde Apr 07 '17 at 12:18
-
1Additionally, this answer doesn't actually solve their problem as it is also too broad. This is a perfect example of why these questions *can't* be answered. – John Conde Apr 07 '17 at 12:19
1
As you send email, make an entry in db of current timestamp, and when user open that email and click to activate verify if the time not exceeded with the mail send time + 5 hours.

D. Pachauri
- 244
- 2
- 8
-
1Please don't post answers on obviously off-topic questions! [See: **Should one advise on off topic questions?**](http://meta.stackoverflow.com/q/276572/1768232) Off-topic questions can be closed and deleted, which could nullify your contribution. – John Conde Apr 07 '17 at 12:18
-