views:

30

answers:

0

In our ASP.Net site we only allow users in from certain countries by checking and filtering their IP address by range. One of the features of the site is we have a bypass IP check query string argument. This argument just sets a bypass cookie in case they click other links beyond the initial landing page which we can check to keep the bypass alive for an arbitrary duration.

The problem is after the initial page the cookie that was set is useless. The reason is that ASP.Net did not notify the client browser of the cookie change because the page was output cached. Because of this subsequent links that are clicked are redirected because the cookie is not there, because the browser never got it!

So far the best solution that i've found is to cause the page to be a cache miss request by request (only works in 3.5 or greater). This to me seems like a hack and a serious design flaw in ASP.Net output caching. What is the best solution to this problem?