How to set hyperlink expiration after one click in asp.net

we send a hyperlink in an email to users. if the user clicks this hyperlink only once. if he clicks this hyperlink a second time, it should expire.

Thank you in advance

+4
source share
1 answer

You need to have a unique identifier in each link and store the identifiers on the server side, usually in the database. Then in each request you need:

  • check if id has already been used
  • if it was, make the "link expired" or do whatever you want.
  • if this is the first time you see this request in a request, mark it in your db and return the desired response

It is useful to use a GUID or add an additional parameter with a hash so that users do not guess other identifiers (depending on your use case).

+4
source

Source: https://habr.com/ru/post/1443214/


All Articles