Increase reCAPTCHA session timeout

2019-04-05 08:37发布

问题:

I'm using the Google reCAPTCHA component and have been asked to increase the session timeout. I couldn't find any solution for this. Can it be done? Many thanks.

回答1:

I'm afraid there's no solution for this, as the reCAPTCHA challenge is served from Google, so the session is not between your app and the user but with the reCAPTCHA service and the user. Think of reCAPTCHA as a multi-tenant web app (where each tenant is the site that's displaying it), and the only settings available to each tenant are the authentication keys and the type of challenge that should be displayed.



回答2:

One solution is to change the way you are submitting your form. Move the reCaptcha submission to a secondary server side page if possible. This will create a fresh condition where the interaction with Google is immediate.

We had the same problem on lengthy forms (multiple tabs). Posting the form to a secondary processing page allows for an immediate processing of reCaptcha which will solve this problem.