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 8311359
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T19:47:27+00:00 2026-06-08T19:47:27+00:00

There is a Java application requesting a page and I wish to block it.

  • 0

There is a Java application requesting a page and I wish to block it.

One way I thought to do this was to use sessions or cookies, but I wasn’t sure if the Java URL method could handle them or not.

Is there another way besides using sessions or cookies that I could distinguish requests from this Java application and block it? I know it has a unique Java user-agent header but I wish to be more accurate.

  • 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-08T19:47:29+00:00Added an answer on June 8, 2026 at 7:47 pm

    The answer to the headline Question is that the URL.openXxx methods do not understand cookies.

    (If your server is configured to accept session tokens in the request URL itself, the URL.openXxx methods won’t get in the way. However, that approach is insecure.)

    Then we come to the body of your Question.

    … is there another way besides using sessions or cookies that i could distinguish requests from this java app and block it?

    At this point, I assume that you are talking about blocking requests on the server side. And I should point out that what the “bad guy” client uses to send the request is now immaterial. (It could use URL or Apache HTTPComponents or it could implement the HTTP protocol stack in assembly code!)

    So the real question is what options you have for blocking unwanted requests. And the answer is:

    • You could block based on the request URL itself, though this is probably counter-productive.
    • You could block based on the presence of session (or other) cookies in the request headers. This is the normal way of doing access control, and assuming that you issue and handle the cookies securely, this is hard to defeat.
    • You could require that session tokens are passed in the request URL, but this has fundamental security issues.
    • You could rely on other “informative” headers … such as the user-agent header, but this is trivial to defeat.
    • You could block based on the request source IP address, but all the bad guy needs to do is to send the requests from a different IP address.
    • You could limit access by using HTTP over SSL/TLS with client-side certificates, but this means that you have to manage certificates for all legitimate client hosts, which is problematic in most environments.

    In summary, cookies are the best solution, so the “good guy” client application needs to use libraries that are capable of doing cookie management and setting cookies in requests.

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

Sidebar

Related Questions

Is there a way to run this command line within a Java application? java
Is there a way to use Eclipse to connect to a Java application started
Is there a way to convert a Java application into a Mac OS X
Possible Duplicate: How to implement a single instance Java application? is there a way
is there a way to call java me application out of Symbian's C++ app?
Is there a way to write a Java Swing application with a custom chrome?
Is there any way to customize Java application's title bar? I don't mean app
Is there a way to access Oracle table level statistics in a Java application
I want to use a Microsoft .Net Assembly in a Java Application. Is there
Is there a Java Application Architecture Guide that is a counterpart of this: http://www.codeplex.com/AppArchGuide

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.