Click here to Skip to main content
16,022,205 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I was developing a feature to send encoded ID and password values via an HTTPS protocol link, aiming to retrieve the session values and other returned cookies upon successful login.

Despite numerous attempts with C# HttpWebRequest and even Python requests, I failed to retrieve the cookies upon successful login.

Then, I tried using Java HttpsURLConnection with the same headers and content for a POST request to the given link. This time, I received a proper login response and successfully logged in.

Afterwards, I noticed that following this successful login with Java HttpsURLConnection, both the C# HttpWebRequest and Python requests methods, which had previously failed, were now able to retrieve the correct login cookies without any issues. This has left me puzzled.

I am now trying to understand why the methods using C# HttpWebRequest and Python requests initially failed but succeeded after the Java HttpsURLConnection request. It seems something changed on my computer system after using Java HttpsURLConnection.

Could you help explain what settings might have been changed or what impact Java HttpsURLConnection had on my computer that allowed the other methods to start working correctly?

What I have tried:

Sending a POST request to a server using the HTTPS protocol with AJAX functionality to attempt login and receive the correct response.
Posted
Comments
OriginalGriff 23-Jul-24 0:22am    
There is a secret error in your secret code that we can't see for security reasons ...

Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - we get no other context for your project.

Use the "Improve question" widget to edit your question and provide better information.

1 solution

There is no correlation on the client side between your Java code working and then completely unrelated technologies starting to work. What I would say is a lot likelier is that something was fixed at the server end, which returned the cookie and your Java happened to connect after this point; and then, the same fix was available for the other technologies because it was the server that was fixed, not the client.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900