Hello,

This may seem trivial to most of you but I bet this will help learner like
me so heres my question. I use the following method to validate a http
session. I have 2 instance of Tomcat 4.1.24 + mod_jk + Apache2 that
replicate session in-memory (JavaGroups stuff). After I deliberately
shutdown one instance, I see that requests to the other instance but while
validating sessions I go to the line where I put block comments ("I get to
this line on Node 2 ...") and eventually invalidate() them. Why does
session.isNew() return true on the second instance? 


private boolean isValidSession(HttpServletRequest request,
HttpServletResponse response)
{
        try
        {
                HttpSession session = request.getSession(true);
                if( ! session.isNew() )
                {
                        if( session != null )
                        {
                                Hashtable sessionStuff =
(Hashtable)session.getAttribute("someSessionStuff");

                                try
                                {
                                        // Do something with "sessionStuff"
...
                                }
                                catch(Exception exp)
                                {
        
session.removeAttribute("sessionStuff");
                                        session.invalidate();
                                        return false;
                                }
                        }
                        else
                        {
                                session.invalidate();
                                return false;
                        }
                }
                else
                {
                        /************************************** 
                         * I get to this line on Node 2 ...
                         **************************************/
                        session.invalidate();
                        return false;
                }
        }
        catch(Exception e)
        {
                e.printStackTrace();
        }

        return true;
}

Regards,
Vijay Kandy

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

Reply via email to