Patent ID: 7774834

Claim:
A method for adaptively generating exception rules to rejection rules for filtering messages, comprising: (a) receiving, by an intermediary device between a client and a server, a first message of a first user session, the first message having a first URL comprising a plurality of hierarchically related URL components, the plurality of hierarchically related URL components comprising a first URL component and a second URL component, the second URL component being a descendant of the first URL component; (b) rejecting, by the intermediary device, the first message based on a rejection rule that rejects messages having the first URL component; (c) maintaining, by the intermediary device, a first number of user sessions each having one or more messages rejected based on the first URL component; (d) maintaining, by the intermediary device, a second number of user sessions each having one or more messages rejected based on the second URL component; (e) determining, by the intermediary device, that the first number of user sessions exceeds a threshold and that the second number of user sessions does not exceed the threshold; (f) generating, by the intermediary device, an exception rule to the rejection rule responsive to the determination, the exception rule allowing messages having the first URL component to pass; (g) receiving, by the intermediary device, a second message of the first user session having the first URL component; and (h) allowing, by the intermediary device, the second message of the first user session to pass between the client and the server based on the exception rule that allows messages having the first URL component to pass.