Reputation: 1
I have a URL something like below. The URL gets generated each time, basically links are ephemeral. I want to mark this link as obsolete/invalid once it has been accessed in a browser. The second time when we access this URL, it should say invalid link. URL format is having an auth token. How can we do this in C#?
Link must be marked as invalid once used.
Upvotes: 0
Views: 162
Reputation: 334
I don't think this can be done just by code.
I think a workaround would be to store the links on your server (database, file or watever). When someone uses the link you can check on that db if the link has been used and mark it as "used" if not.
Something like:
id | Link (string) | Used (boolean) |
---|---|---|
1 | https://stack... | 1 |
2 | https://stack... | 1 |
3 | https://stack... | 0 |
Upvotes: 0