You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Greg Vilardi <gv...@recurrentsoft.com> on 2005/04/22 00:03:55 UTC

Session attributes disappear between .jsp pages

Hi. I've got an odd problem that I'm hoping that someone can help to diagnose.

 A new application that we're building is losing attributes of a session 
between SOME of its pages. This behavior occurs about 85% of the time. 
Sometimes all of our session will transmit and most times about half of the 
objects get through. The objects that always come through are strings and some 
numbers. The bits that occasionally get through are our database connector 
object, our menu bar class and a couple of other ints. The kicker is that the 
entire session is created by a java object called from a jsp (login) and it 
ALWAYS propagates to the next page correctly. The transition between the second 
and third page, whether it is a redrect or a link causes, the problem. We've 
reduced the page that this occurs on to something that just enumerates the 
session and has a link to itself. I'm including the page source at the end of 
the message.

We're running Tomcat 5.0.28 through Apache (Apache/2.0.52 (Unix) mod_ssl/2.0.52 
OpenSSL/0.9.6m mod_jk/1.2.6 Server at devlinux.recurrentsoft.com Port 443) on 
Debian unstable patched two days ago.

The other thing that has me chasing my tail is that we have a much more complex 
system using the same core library with massive sessions and similar objects 
that work fine on the same system. For those of you who are still reading, 
(thank you!) the sequence of events is that we start by keying the URI for 
login.jsp into the browser. We then login to the database, and a session is 
created and populated. When we finish logging in, the system sends a redirect 
that brings us to bbs.jsp (below).  When we arrive the session has all 
attributes we expect. Clicking on the middle link at the bottom of the page 
causes the problem.

Any insight that you may be able to offer would _really_ be appreciated. My 
brain is currently trying to claw its way out of my skull to escape impending 
madness.

	-Greg

----------------- begin bbs.jsp
<%@ page buffer="50kb"
         language="java" 
         
import="com.recurrentsoft.util.*,com.recurrentsoft.biz.*,com.recurrents
oft.hbiz.*,com.recurrentsoft.hutil.*,java.util.*,java.io.*" %>
<html>
<body>
<%
Enumeration en = session.getAttributeNames();
while (en.hasMoreElements()) {
    String sName = (String)en.nextElement();
%>
    <%=sName%> = <%=session.getAttribute(sName)%><br>
<%
}
session.setAttribute("BeenInBBS","yes");
    //session.removeAttribute("UserID");
    //session.removeAttribute("Pass");
    //session.removeAttribute("SecurityLevel");
    session.removeAttribute("Intl");
    //session.removeAttribute("Properties");
    session.removeAttribute("BizObj");
    session.removeAttribute("MenuBar");
%>
<a href="bbsmaint.jsp">bbsmaint.jsp</a>
<a href="bbs.jsp">bbs.jsp</a>
<a href="tempsysadm.jsp">tempsysadm.jsp</a>
</body>
</html>
------------------- end bbs.jsp-- 
Gregory H. Vilardi    631-752-2701x240     gvilardi@recurrentsoft.com
Project Manager / Lead Software Engineer           Fax: (631)752-3397
Recurrent Software Solutions, Inc.       http://www.recurrentsoft.com
1 Huntington Quadrangle, Suite 1C02, Melville, NY 11747 


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org