Accessing original URL in IIS7 404 redirect page

I have an .aspx page as my custom 404 page on a site set up on IIS 7. I need to retrieve the original URL that the user was trying to access in order to do some processing on the 404 page. The trick is that I need to specifically handle 404’s that do not contain a .aspx extension (e.g http://example.com/testurl), which do not get routed through ASP.NET’s custom errors section. I can configure IIS to point to my custom 404, but at that point I do not know how to get my original URL? Does anyone know if this is possible?

Asp.net forms authentication cookie not honoring timeout with IIS7

Authentication cookies seem to timeout after a short period of time (a day or so). I am using Forms Authentication and have the timeout=”10080″ with slidingExpiration=”false” in the web.config. With that setting, the cookie should expire roughly 7 days after the user is successfully authenticated.