验证码超时

huangapple go评论80阅读模式
英文:

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.

huangapple
  • 本文由 发表于 2014年11月7日 17:01:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/26797559.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定