8

The fuck? I'm trying to automate login for an asp.net website from a C# console app using HttpWebRequests. I used Fiddler to see how the login happens and how the browser obtains the session and auth cookies from the server. When I replicate the same procedure from C#, I am able to get both cookies withoth a problem, but when I try to use them to get data about the user, I get a 500 ISE. What the actual fuck? I've double-checked every single header and the URLs and it's doing literally the same thing as chrome: Get asp session id (POST)-> get an auth cookie (POST username and passwd) -> interact with the site using the session id and auth cookie (GET). And obiviously I don't have access to the server logs... :/

Comments
  • 3
    Just to clarify: I'm using three separate HttpWebRequests with a shared CookieContainer. The first one gets the session id, the second one gets the auth code, and the third one is supposed to get some data about my user profile, that's where I het the 500 error.
  • 1
    I’ve had better luck with ChromeDriver with HtmlAgilityPack than HttpWebRequests.
Add Comment