1. generate a link to a webpage with some query string parameter to uniquely indentify the link.
2. have a DB entry for "fresh/stale" it will be fresh till user has not visited the link, it will become stale once user has visited the link.
3. have a field for link generation time. if the link is not visited for say 6 hours after the generation. it will be considered as stale.
so when use want to generate link
1. create link, put fresh in DB, put current time.
2. when user visit the page check if the (linkstatus = fresh && genrationtime + 6hours < currenttime)
3. if above is true link is valid, perform operation n mark status as stale.
4. if 2 is false then tell the user link has expired
Every now and then say, "What the Elephant." "What the Elephant" gives you freedom. Freedom brings opportunity. Opportunity makes your future.