简体   繁体   English

如何使验证码跨多个页面工作?

[英]How can I make CAPTCHA work across multiple pages?

Ever visit a website such as myspace where they leverage CAPTCHA to prevent spam? 您是否曾经访问过像myspace这样的网站,他们利用CAPTCHA来防止垃圾邮件? The typical pattern is to present a challenge to each URL that is opened, yet the challenge doesn't actually belong to the page itself which causes additional bandwidth usage. 典型的模式是对每个打开的URL提出挑战,但是挑战实际上并​​不属于页面本身,这会导致额外的带宽使用。

So, if I open up six pages at the same time and want to present a challenge on each page. 因此,如果我同时打开六个页面,并且想在每个页面上提出一个挑战。 I want the challenge to be tied to the page and not to the session. 我希望挑战与页面无关,而不与会议相关。 How can I make this work with Spring and/or Struts. 如何使用Spring和/或Struts进行这项工作。

This depends largely on what you are using for rendering the pages. 这在很大程度上取决于您用于呈现页面的内容。 Spring MVC? 春季MVC? Struts? 撑杆? You can tie components to pages in most of these frameworks. 您可以在大多数这些框架中将组件绑定到页面。

You can also maybe think of a workaround where each page registers his captcha in the session in a seperate key, and have the page check against it's own value. 您可能还可以想到一种变通方法,其中每个页面使用单独的密钥在会话中注册其验证码,然后让页面根据其自身的值进行检查。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM