commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Charles Huey" <>
Subject same instance of HttpClient seen as a different session with every GET
Date Sun, 08 Aug 2004 17:29:06 GMT
I'm trying to use a small command line program with HttpClient to browse
our website every two minutes, and an instance of HttpClient is a member
of my program's class OurSiteBrowser.  In the constructor, I set up the
Credentials to access our site using BASIC authentication like so:

        Credentials defaultcreds = new UsernamePasswordCredentials(user,
        hc.getState().setCredentials(null, "",

I have a while(true) loop that I use to GET a certain page on our
website, and at the end of the loop it always waits 2 minutes.  The 
session timeouts are set to approximately 2 hours, and I noticed while
running this overnight that my session count was hovering around 60+ (I
recently implemented a session listener to get more info than Tomcat was
giving me about our traffic).  I don't really think anyone would have
been using this particular website in the middle of the night, and when
I checked my log info, it struck me that every time my program accessed
the secure (HTTPS) URL it was page-scraping, a new session appeared to
be opened on the server instead of the server identifying my HttpClient
as being the same browser or whatever.  I'm using the httpclient-2.0.jar
-- shouldn't our website/Tomcat be identifying my HttpClient program as
the same browser and thus let it use the first session it creates for


P.S.  I guess we might have some bad design somewhere as well, because
out of the total memory allocated to the JVM, the free memory kept
decreasing through the night.  Strange, because during the day, even
though free memory often decreases a lot, it also climbs back up a lot.  

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message