AIP with web gardens

Topics: General Discussion, General Help
Jun 27, 2008 at 3:13 PM
Ok, I tried your 2 beta version with web gardens. Unfortunately it doesn't seem to work.
This what I did:
in web.config

<autoInputProtection persistenceMode="Session" defaultTextProvider="random characters" defaultImageProvider="resource">
...

 

<

sessionState mode="StateServer" timeout="15" stateConnectionString="tcpip=localhost:42424" cookieless="false"/>

 

<

httpHandlers>
    <add path="AIP.ashx" verb="GET" type="DaveSexton.Web.Controls.AutoInputProtectionSessionRequestHandler, DaveSexton.AutoInputProtection"/>

 


The last line due to the fact that  I don't use Session, but for AIP. Then, in the page I use the following code:

 

<dsweb:AutoInputProtectionControl runat=server ID="AutoInputProtectionControl1" LabelText="" TextBoxStyle-CssClass="form" TextBoxStyle-Width="95%" ImageStyle-Width="200px" InvalidErrorMessage="" RequiredErrorMessage="" >

 

 

<Template>

 

 

<td valign="top" width="50%"><asp:TextBox runat="server" ID="Text" /></td>

 

 

<td rowspan="2" valign="top" width="50%">&nbsp;&nbsp;<asp:Image runat="server" ID="Image" /></td>

 

 

<asp:RequiredFieldValidator runat="server" ID="RequiredValidator" ControlToValidate="Text" Display="None" EnableClientScript="false" />

 

 

<asp:CustomValidator runat="server" ID="Validator" ControlToValidate="Text" Display="None" EnableClientScript="false"/>

 

 

</Template>

 

 

</dsweb:AutoInputProtectionControl>

 


I checked the Session and it works fine, maintaining data across gardens. But, as for AIP validation, I was unable to make it work.
Any idea?

H


Coordinator
Jun 27, 2008 at 4:51 PM
Hi,

At first glance everything looks OK.  I'll take a closer look tonight and see if I can reproduce the problem.

- Dave
Coordinator
Jul 19, 2008 at 11:28 PM
Hi,

I can't reproduce the issue, possibly becasue I don't have a multi-processor system to test a true web garden setup, however testing with StateServer and Session persistence mode has at least proven to be successful on a single-processor system.

To test your scenario as best as I could, I copied your AIP and web configuration examples into my test project (i.e., I configured and started the ASP.NET StateServer and enabled AIP Session persistence mode) yet the AIP web control still works without any issues.

Note that since I have hyperthreading enabled on my single processor I thought that maybe enabling the web garden configuration in the machine.config might work, but testing showed that every request is handled by a single worker process anyway.  Although, since we're using a state server I can't see how enabling web garden support could have any negative effect on AIP.

Please try enabling trace output on the page that contains the AIP web control. (Obviously, not in a production environment though!)

The initial request to the page should produce a few lines like this:

AIP Image Generated Answer: 76649; Size: {Width=150, Height=50}; Public key: Z4+II4oNL/4v235qnntukATtG40= 0.00709056597975441 0.006601
AIP Answer Cached Answer: 76649 0.00851756298635721 0.001427

Make sure that the answer actually corresponds with the text on the image.

Submitting the form with the correct answer should produce the following trace output (to see it though you'll have to disable the business logic that redirects the user, if there is any):

AIP Validation Answer: 76649; User input: 76649; passed 0.00512523239685491 0.003564

If you see anything out of the ordinary please let me know.

- Dave