|| at May 18, 2005 at 12:49 pm
If you have the request object you can
String remoteAddr = pRequest.getRemoteAddr();
String remoteHost = pRequest.getRemoteHost();
InetAddress pInetAddress = InetAddress.getByName(remoteAddr);
pInetAddress.getHostAddress(); // gets the IP
I don't know on top of my head how to get from the session.
From: Hendrik Neumann
Sent: Wednesday, May 18, 2005 5:26 AM
Subject: Re: What is happening to the session if a user closes his
Thank you very much for your answers Pierpaolo and Mathias. I have just implemented Mathias' solution with the Session-Listener and it works perfect!
By the way: is it possivle to get the ip-address associated with a session? I have not found a method like getIPAdress() and the method myHttpSessionEvent.getSource() does also not contain the ip address. Is there another solution to get it, because I want to write something like "Session created for 127.0.0.1" in my logfile. Is it possible?
Mit WEB.DE FreePhone mit hoechster Qualitaet ab 0 Ct./Min.
weltweit telefonieren! http://freephone.web.de/?mc=021201