Session expired
Hi, I am working on a JSP / Servlet application where in the session is expired as soon as I enter a servlet from the JSP page. I do not know the reason why this is happening. From JSP to JSP it works good. I am using Tomcat 5.0.19 Any idea would be great. Thank you, Best Regards, Uma - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
difference between session expired or session new
Hi, I have an app in which users do not have to login, but each user does have its own session. I tried to come with a way to detect whether the users current session has expired, but I can't seem to find a way to differentiate between 'no' session and an 'expired' session. What I had was: if (request.getRequestedSessionId() != null !request.isRequestedSessionIdValid()) { response.sendRedirect(this.getInitParameter(session_timeout_url)); return; } this works, as long as the servlet is not called from a different context in which another session is already active. If I use a sessionlistener to flag somewhere that the session for a certain session id is no longer valid, this 'flag'repository will keep on growing, it would probably take forever to cause problems, still is doesn't seem like a good solution. Why isn't there something like session.isValid(); so that request.getSession(false) returns a session object which can be queried for validness? Now it returns null, which makes it a bit hard to determine session history. Greetz Hans - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: session expired
Hi, we found an error in Tomcat works with session refreshing. When requesting session, it refreshes itself but with time of previous request. So after a period of time, session always unexpectedly timed-out. We have reported that to Bugzilla so suppose the fix will be available in next release. I can offer you a fixed and rebuild catalina.jar file. Milan Petran -Original Message- From: J. Prez [mailto:[EMAIL PROTECTED] Sent: Thursday, April 03, 2003 11:20 AM To: [EMAIL PROTECTED] Subject: session expired Hi, Can anyone explain in details how do I set the session timeout? I tried changing the web.xml in C:\jakarta-tomcat-4.1.8\webapps\ROOT\WEB-INF and also the web.xml in C:\jakarta-tomcat-4.1.8\conf and nothing happened (it times out after 30 min ). Below you can find the web.xml under the WEB-INF. Any help will be appreciate. J.Prez ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app servlet servlet-classcom.niceeye.portal.common.StartupServlet/servlet-class load-on-startup/load-on-startup /servlet session-config session-timeout1/session-timeout /session-config /web-app Jess Prez Franco Tlf: (+34) 913212059 Fax: (+34) 913378822 [EMAIL PROTECTED] Llave pblica PGP Ingeniero en Informtica Telefnica Soluciones Sor ngela de la Cruz, 3. Planta 1. 28020 Madrid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
session expired
Hi, Can anyone explain in details how do I set the session timeout? I tried changing the web.xml in C:\jakarta-tomcat-4.1.8\webapps\ROOT\WEB-INF and also the web.xml in C:\jakarta-tomcat-4.1.8\conf and nothing happened (it times out after 30 min ). Belowyou can find the web.xml under the WEB-INF. Any help will be appreciate. J.Prez ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd web-app servlet servlet-classcom.niceeye.portal.common.StartupServlet/servlet-class load-on-startup/load-on-startup /servlet session-config session-timeout1/session-timeout /session-config /web-app JessPrezFranco Tlf:(+34)913212059Fax:(+34)913378822 [EMAIL PROTECTED] Llave pblica PGP Ingeniero en Informtica Telefnica Soluciones SorngeladelaCruz,3. Planta1.28020Madrid signature.asc Description: Esta parte del mensaje =?ISO-8859-1?Q?est=E1?= firmadadigitalmente
Re: session expired
Session timeout is set in Tomcat\conf\web.xml !-- Default Session Configuration = -- !-- You can set the default session timeout (in minutes) for all newly -- !-- created sessions by modifying the value below. -- session-config session-timeout30/session-timeout /session-config J. Prez wrote: Hi, Can anyone explain in details how do I set the session timeout? I tried changing the web.xml in C:\jakarta-tomcat-4.1.8\webapps\ROOT\WEB-INF and also the web.xml in C:\jakarta-tomcat-4.1.8\conf and nothing happened (it times out after 30 min ). Below you can find the web.xml under the WEB-INF. Any help will be appreciate. J.Prez ?xml version=1.0 encoding=ISO-8859-1? !DOCTYPE web-app PUBLIC -//Sun Microsystems, Inc.//DTD Web Application 2.2//EN http://java.sun.com/j2ee/dtds/web-app_2_2.dtd; web-app servlet servlet-classcom.niceeye.portal.common.StartupServlet/servlet-class load-on-startup/load-on-startup /servlet session-config session-timeout1/session-timeout /session-config /web-app Jess Prez Franco Tlf: (+34) 913212059 Fax: (+34) 913378822 [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] Llave pblica PGP http://usuarios.lycos.es/jperezfranco/public-key.asc Ingeniero en Informtica Telefnica Soluciones Sor ngela de la Cruz, 3. Planta 1. 28020 Madrid - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Junk after session expired
Hope someone can help: Config: Win NT, Tomcat 3.2.3, Apache 1.3.2 ( according to bundled changes log). Have configured a simple JSP app that starts at a login page and maintains a session bean across pages. At the start of each page we need to check for no session/session expired. If this is the case then response.sendRedirect() is used to redirect to a page that explains this:- --- Start of *.jsp - %@ page language=java % % HttpSession oldSession = request.getSession(false); if( oldSession == null ) { response.sendRedirect( response.encodeRedirectURL( ../jsp/no_session.jsp ) ); } % - Rest of *.jsp would follow here --- This just does not work as we would like. When a redirect happens the generated html page, no_session.jsp, gets filled with rubbish. It is as if there is a buffer that is not being flushed somewhere. I have noticed in the 'rubbish' that gets displayed the odd exception (invalid state on one occasion), but this is not consistent and more often displays fragments of HTML from the target page. Advice welcomed. Cheers, Mark. *** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Junk after session expired
You need to add return; after calling sendRedirect. All sendRedirect does is to call setHeader with the appropriate values for you, its still up to you to cancel out of the remainder of the page's logic. Randy -Original Message- From: Mark Meany [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 8:03 AM To: 'Tomcat Users List' Subject: Junk after session expired Hope someone can help: Config: Win NT, Tomcat 3.2.3, Apache 1.3.2 ( according to bundled changes log). Have configured a simple JSP app that starts at a login page and maintains a session bean across pages. At the start of each page we need to check for no session/session expired. If this is the case then response.sendRedirect() is used to redirect to a page that explains this:- --- Start of *.jsp - %@ page language=java % % HttpSession oldSession = request.getSession(false); if( oldSession == null ) { response.sendRedirect( response.encodeRedirectURL( ../jsp/no_session.jsp ) ); } % - Rest of *.jsp would follow here --- This just does not work as we would like. When a redirect happens the generated html page, no_session.jsp, gets filled with rubbish. It is as if there is a buffer that is not being flushed somewhere. I have noticed in the 'rubbish' that gets displayed the odd exception (invalid state on one occasion), but this is not consistent and more often displays fragments of HTML from the target page. Advice welcomed. Cheers, Mark. *** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Junk after session expired
you have to append a return; - statement after the redirect, because the current page will be rendered, too cheers pero -Original Message- From: Mark Meany [mailto:[EMAIL PROTECTED]] Sent: Thursday, January 31, 2002 2:03 PM To: 'Tomcat Users List' Subject: Junk after session expired Hope someone can help: Config: Win NT, Tomcat 3.2.3, Apache 1.3.2 ( according to bundled changes log). Have configured a simple JSP app that starts at a login page and maintains a session bean across pages. At the start of each page we need to check for no session/session expired. If this is the case then response.sendRedirect() is used to redirect to a page that explains this:- --- Start of *.jsp - %@ page language=java % % HttpSession oldSession = request.getSession(false); if( oldSession == null ) { response.sendRedirect( response.encodeRedirectURL( ../jsp/no_session.jsp ) ); } % - Rest of *.jsp would follow here --- This just does not work as we would like. When a redirect happens the generated html page, no_session.jsp, gets filled with rubbish. It is as if there is a buffer that is not being flushed somewhere. I have noticed in the 'rubbish' that gets displayed the odd exception (invalid state on one occasion), but this is not consistent and more often displays fragments of HTML from the target page. Advice welcomed. Cheers, Mark. *** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED] -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]
RE: Junk after session expired
Thanks for the advice. In practise there was a 'return;' statement before the close brace, but this got lost during cut-n-paste. We still had the same problem. Have changed code now to use jsp:forward .. and all is well in the world. M. *** For more information on Ordnance Survey products and services, visit our web site at http://www.ordnancesurvey.co.uk *** -- To unsubscribe: mailto:[EMAIL PROTECTED] For additional commands: mailto:[EMAIL PROTECTED] Troubles with the list: mailto:[EMAIL PROTECTED]