tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Barker" <>
Subject Re: Rproblem: New Session created on each new JSP
Date Sat, 24 May 2003 02:50:10 GMT
I've never seen anything like this in TC 3.3 (but that doesn't necessarily
mean it doesn't exist :).  There is a known session-related bug in 3.3.1 (BZ
#15894), but it looks very different from what you discribe.

To get more information to track this down, try setting the debug="1"
attribute on the SessionId element in server.xml.  This will produce a trace
in the logs of what cookies were found, etc.  You could also set the debug
attribute on other Session-related elements, but they are probably less

Alternatively, if you can strip your webapp down something simple that
reliably reproduces the problem, then you can post it to BZ
(, and the Tomcat developers can take a
look at what the problem is.

"Padraig Cooney" <> wrote in message
Dear friends,

I have problem in a JSP app run on tomcat3.3 whereby a session does not
exist for more than one page. The problem is encountered whenever I try to
use a session variable created in a previous JSP. I have done my system.outs
and a new session is created from page to page instead of using the existing
session. This is what I posted on one of the forums:
My problem is that I can't maintain a session over more than one page. I
create a session in validateLogin.jsp:

isAdmin = customerProfileBean.isUserAdmin(username);

System.out.println("User Type is "+isAdmin+" in validateLogin");
System.out.println("Max Inactive Interval is:
System.out.println("Session.isNew() is "+session.isNew()+" in validate");
System.out.println("Session.getId() is "+session.getId()+" in validate");

Then I re-direct to myLucidity.jsp, and try to access the session:

String user = null;
user = (String)session.getAttribute("user");
System.out.println("User is "+user+" in myLucidity");
System.out.println("Session.isNew() is "+session.isNew()+" in myLucidity");
System.out.println("Session.getId() is "+session.getId()+" in myLucidity");

session.isNew() is "true" in both cases, and session.getId() returns
different values. In other words, a new session is created in myLucidity.jsp
rather than using the session started in validateLogin.jsp, as it should.

I have checked the max inactive interval for the session and it's 1800, so
that's not the problem.

My browser is set to "Accept All Cookies", so they're stored locally. In
server.xml, I have:
<SessionId cookiesFirst="true" noCookies="false" />
<SimpleSessionStore maxActiveSessions="-1" />
Can anyone help?


Padraig Cooney.

Registration House
3 Woodbine Park
Co Dublin

T +353 1 2830777
F +353 1 2830787

Founding Member of RAID - Registrars Association of Internet Domains
Member of the IE Domain Registry Affiliate Program
Member of the IIA - Irish Internet Association

The information contained in this communication is intended solely for
the use of the individual or entity to whom it is addressed and others
authorized to receive it.  It may contain confidential or legally
privileged information.  If you are not the intended recipient you are
hereby notified that any disclosure, copying, distribution or taking any
action in reliance on the contents of this information is strictly
prohibited and may be unlawful.  If you have received this communication
in error, please notify us immediately by responding to this email and
then deleting it from your system. is neither liable for the
proper and complete transmission of the information contained in this
communication nor for any delay in its receipt.

This footnote also confirms that this email message has been checked
for the presence of Computer viruses by

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message