I want to write a Java program that’ll access a few web pages that requires logging in. How would I keep the session cookie resulting from logging in so I can access those pages?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Commons HTTPClient has all the capability to do what you want. You can do any sort of authentication and cookie handling that you need. Here is the code for the CookieDemoApp.