hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bindul Bhowmik" <bindulbhow...@gmail.com>
Subject Re: How to invalidate session?
Date Fri, 05 May 2006 00:27:26 GMT

You cannot invalidate a session using HttpClient.

The 'request.getSession().invalidate()' is a J2EE way of 'invalidating' a
session on a servlet container. HttpClient doesn't even know about the
session on the server.

If on the server however you have a servlet which when invoked would
invalidate the session, you could use HttpClient to send in that request and
the session would be invalidated. Or you could just let the session expire
on its own.


On 5/4/06, Ashish Kulkarni <ashish.kulkarni13@gmail.com> wrote:
> Hi
> I am doing the following
> HttpClient client = new HttpClient();
> PostMethod postMethod = new PostMethod(url);
> postMethod.setRequestBody(data);            postMethod.getParams
> ().setParameter(HttpMethodParams.RETRY_HANDLER,
>                     new DefaultHttpMethodRetryHandler(3, false));
> int statusCode = client.executeMethod(postMethod);
> Now i want to invlidate the session created on server
> Normally i would do
> request.getSession().invalidate();
> How to do it using http client
> Ashish

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message