Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7742281
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:14:12+00:00 2026-06-01T09:14:12+00:00

How would I go on using the logged-in session that I attained through use

  • 0

How would I go on using the logged-in session that I attained through use of Apache’s httpcomponents to utilize html (code-wise) on a site that requires you to be logged in?

This is what it looks like when I use httpcomponents:

        HttpPost httpost = new HttpPost("http://whatever.com/login.php");

    List<NameValuePair> nvps = new ArrayList<NameValuePair>();
    nvps.add(new BasicNameValuePair("email", "whatever")); //set your own username
    nvps.add(new BasicNameValuePair("password", "whatever")); //set your own password

    httpost.setEntity(new UrlEncodedFormEntity(nvps, HTTP.UTF_8));

    HttpResponse response = httpclient.execute(httpost);
    HttpEntity entity = response.getEntity();

I assume that the answer to my problem lies somewhere with the HttpEntity class, but I feel like I am stuck..

To clarify: After I’ve logged in as shown above, I would need to access a page, with the session from above, that requires you to be logged in (e.g. membersonly.php or whatever), and then read and use the content from this page in Java.

Hope I made myself clear enough 🙂 Looking forward to any answer.

Mike

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T09:14:13+00:00Added an answer on June 1, 2026 at 9:14 am

    Usually, HTTP sessions are tracked through cookies received from the server which must be sent in the subsequent requests.

    Just follow this example which performs form-based login.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using System.data.odbc to communicate with my MySQL db. When logged, I would
To use modular exponentiation as you would require when using the Fermat Primality Test
I have a few .Net projects that would benefit from using a document/object database
MVC3 vb.net Application using built in session management. I have an mvc3 application that
I'm developing a web application that involves the use of timestamps. I would like
Would you recommend using a datetime or a timestamp field, and why (using MySQL)?
I know how I would achieve this using PHP, but with jQuery / JavaScript
In the web using c# would be simple System.Web.HttpUtility.HtmlDecode() but now I am using
I'm planning to a webapp where every guy using it would have a client
To all those familiar with D programming language , how would go about using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.