Jose,

Unfortunately, this approach would be somewhat unreliable, depending
on the sites accessing Tomcat. Most corporate networks are protected
by a firewall and many of the do "Dynamic Network Address Translation".
Dynamic NAT is used to hide the real IP address of clients connected
from the internal corporate network.

So, all traffic passing out of the firewall to your site will appear 
to come from the same IP address. 

If your needs are to support know customers that don't have dynamic
NAT, then a session management scheme based on IP address should
be possible.

I know that's probably not helpful, but maybe it will save you the
time of working on a scheme that won't suit your requirements.

Best regards,

Norb



Jose Miguel Guzman wrote:
> 
> Hi Guys
> 
> I need to track sessions based on the Client's IP, instead of using Cookies
> or URL re-writing.. (My clients don't support Cookies, and I cannot re-write
> the URL). I know this sounds useless, but believe me... this is what I
> need.... ;-)
> 
> I found that in the Catalina internal API there is a Manager class
> (org.apache.catalina.Manager) that provides some methods to manipulate the
> Sessions base:
> 
>     Manager.findSession(java.lang.String id)
>     Manager.add(Session session)
>     etc..
> 
> The problem is that I couldn't find a way get a reference for the Manager,
> from the servlet...
> I was trying to do something like:
> 
>     Context context = request.getContext();         <== No such method
> available
>     Manager manager = context.getManager();
>     String id = request.getRemoteAddr().toString();
>     Session sesion = manager.findSession(id);
>     if (sesion == null) {
>         sesion = manager.createSession();
>         sesion.setId(id);
>     }
> 
> but the getContext() method is not available from the
> javax.servlet.http.HttpServletRequest interface.. (It's only accesible from
> the internal org.apache.catalina.connector.RequestBase class).
> 
> Is there a way to access some Manager class implementation (ManagerBase,
> StatandardManager) within the servlet?
> Do someone have some idea for facing this problem?
> 
> Basically, I require to use the client IP address, as the only ID in the
> Session base.
> I would appreciate any help, from more experienced users...
> 
> Thanks, very much...
> 
> Jose Miguel Guzman
> Santiago, Chile.
> 
> PS: Sorry for my English..
> 
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to