AIP Protection on iis6

Topics: General Help
Sep 13, 2007 at 4:10 PM
i've installed your aip control in a web site.
In local host (WinXP) no problem but on a win 2003 server with iis6
sometimes i don't see the image generate by the control (AIP image not found in cache)

can you help me?

Sep 13, 2007 at 5:12 PM
Edited Sep 13, 2007 at 5:12 PM

That message could mean one of two things:

  1. The image's key is invalid.
  2. The bitmap was removed from the ASP.NET cache.
The key is generated from an SHA1 hash of the text, request path, user host address and the current time and it's unlikely that it will be invalid, so the problem is most likely related to the bitmap being removed from the ASP.NET cache.

It's possible that ASP.NET is removing the bitmap from the cache because of a timeout. AIP configures the cached bitmap to expire using a sliding expiration, with no absolute expiration. The value of the sliding expiration is the BitmapCacheTimeoutSeconds property of the AIP web control. The default value is only 15 seconds, so if you're taking a while to submit the form then that's why. You can increase the value of this property to meet your needs.

If that's not the cause then I see only one other possibility. AIP removes the bitmap from the cache upon validation (success or failure) so that there may be only one failed attempt before the CAPTCHA text becomes outdated. To verify that your issue is not related to a bug in this feature, please use tracing to ensure that the ValidateUserInput method is not being called without a form submission. You can do this by creating a new web control that derives from AutoInputProtectionControl. Use this control on your page instead of the AIP control itself. Then override the ValidateUserInput method and either use ASP.NET's built-in tracing features, .NET's diagnostic debug output or simply use HttpContext.Current.Response.Write("Validate input: " + userText + ", " + bitmapText). You need to make sure that when you get the error message the trace information does not appear, which means that the bitmap is not being removed by AIP without an explicit form submission. If you're not submitting the form and you see this message then you've found a bug.

- Dave
Jul 25, 2008 at 2:17 AM

I am having the same issue. Did the recommendations above solve the problem?


Jul 25, 2008 at 6:24 PM
Hi kbranch,

Which version are you using?

- Dave