tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Micael <caraun...@harbornet.com>
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);
>
>session.setAttribute("userType",isAdmin);
>System.out.println("User Type is "+isAdmin+" in validateLogin");
>session.setAttribute("user",username);
>System.out.println("Max Inactive Interval is: 
>"+session.getMaxInactiveInterval());
>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" />
>and
><SimpleSessionStore maxActiveSessions="-1" />
>Can anyone help?
>
>
>
>Regards,
>
>Padraig Cooney.
>
>EASIREG.IE & EASIWEBMAKER.IE
>Registration House
>3 Woodbine Park
>Blackrock
>Co Dublin
>Ireland
>
>T +353 1 2830777
>F +353 1 2830787
>W www.easireg.ie
>E padraig@easiwebmaker.ie
>
>*************************************************************************************
>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.  Easireg.ie 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 www.mcafee.com
>*************************************************************************************
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: tomcat-user-help@jakarta.apache.org



LEGAL NOTICE

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 
you  



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


Mime
View raw message