C# .NET - Why Set HttpWebRequest.AllowAutoRedirect = false?

Asked By Bill on 27-Jan-11 07:39 PM
I've seen quite a bit of code for getting HttpWebRequests.  Most of them follow the practice of setting HttpWebRequest.AllowAutoRedirect = false.  Why is this done when it seems that in most instances you'd like to have the server simply return the correct document rather that having to sort through all the possible HTTPstatusCodes? 
Is this a security issue or does it give you some other advantages when retrieving web documents?

Robbe Morris replied to Bill on 27-Jan-11 08:19 PM
Allow redirect will follow the url if the server sends a redirect response and enable your client to access the redirected url.  Most people set this to false to prevent the http web request from following unknown urls.