英文:
Captcha timeout
问题
为什么我需要一个验证码超时实现?它有什么好处?
在GitHub上查看golang captcha 链接,验证码的过期时间设置为10分钟。程序员为什么要实现验证码的过期时间?
英文:
Why do I need a captcha timeout implementation. For what it is good for?
Look on github golang captcha link, expiration time is here 10 minutes. For which reason do the programmer implement the expiration time for captcha.
答案1
得分: 2
你可以阅读captcha
包的文档,该包用于生成验证码。为了使验证码一次性使用,该包包含一个内存存储,用于存储验证码的ID、答案和过期时间。在调用Verify或VerifyString后,已使用的验证码会立即从存储中删除,而未使用的验证码(用户加载了带有验证码的页面,但未提交表单)会在预定义的过期时间后自动清除。你可以在这里阅读captcha
包的文档。
英文:
> package captcha
>
> import "github.com/dchest/cap
>
> To make captchas one-time, the package includes a memory storage that
> stores captcha ids, their solutions, and expiration time. Used
> captchas are removed from the store immediately after calling Verify
> or VerifyString, while unused captchas (user loaded a page with
> captcha, but didn't submit the form) are collected automatically after
> the predefined expiration time.
Read the captcha
package documentation.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论