tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Micael <>
Subject Re: Rproblem: New Session created on each new JSP
Date Fri, 23 May 2003 14:59:38 GMT
Just a guess, Padraig, but aren't you starting a new id with your 
code?  There will be a session id even if you do nothing, right?  Try 
taking out your setAttribute stuff and see what happens?  Probably not 
helpful, but a stab in the dark.

At 03:33 PM 5/23/03 +0100, you wrote:
>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:


This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 

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

View raw message