开发者

Create a single use link

开发者 https://www.devze.com 2023-01-06 21:37 出处:网络
I\'m writing a database front end for a website.Next to the records I want to include a link likes this:

I'm writing a database front end for a website. Next to the records I want to include a link likes this:

 Record 1 - [Add][1] [Edit][2] [Delete][3]

But I want to protect these links from being used more than once. My thinking is to pass a hash value then store a list of valid HASH values in a table somewhere and only process requests with valid hash values. Is there a better way to do is?

Update: The answer to this question led me to ask this question开发者_如何学Go: What is the difference between a "nonce" and a "GUID"?. Why exactly would you use a nonce instead of a GUID?


Your idea is correct, except that you should use cryptographically secure random bytes (a "nonce") instead of a hash.

0

精彩评论

暂无评论...
验证码 换一张
取 消