The ability to scope the lifetime of a URL for say 10 minutes came up at TechEd. Interestingly enough, I did something similar in the CAPTCHA control I use in my comment forms, so the generated code auto-expires and cannot be used for playback attacks. I thought this was a one-off scenario, but apparently not. In the attendee's case, he wanted to make sure those links could not be navigated to from Google search results.
Based on what I had done, here is what we discussed. Basically figure out a DateTime until when a URL is going to be valid, and encrypt it with something like the Rijndael algorithm from the System.Security.Cryptography namespace, and add that as a query string parameter. Now, on the target page, during OnInit (or perhaps even earlier in the BeginRequest event using a custom HttpModule), check for the query string variable, decrypt it, and redirect if the URL has expired. I am curious if there are there other scenarios people have for limiting lifetime of a URL, as well as other techniques. In discussions like these, I wonder whether there is a useful control scenario in the background. If ASP.NET had good extender provider support (hopefully in v-next), this could be implemented as an extender provider for the HyperLink and Image control.
Of course, I suppose, one should also prevent search engines from saving a cached copy of the expiring pages. I wonder if the robots.txt mechanism could be used to convey restrictions such as this, or to ignore a specific range of paths for search engines to consider. Is that possible?
Posted on Monday, 6/13/2005 @ 8:05 PM
| #
ASP.NET