|
After a couple of day's - struggling with session - upgrading our webserver to WAS v4.0.5 - creating some 'testcode' I only could conclude that there must be a bug in WAS v4.0.x (surprise...) This is what happens: Invalidating and recreating an HttpSession returns the old 'unique' session_id where another new 'unique' session_id should be created. ******************* anyone has a fix for this? ******************* This is the testcode: -------------------- public void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { System.out.println("**** Servlet reactivated"); session = req.getSession(true); if (!(session.isNew())) { System.out.println("next entry, session already active, SESSIONID = " + session.getId()); session.invalidate(); session = req.getSession(true); if (session.isNew()) { System.out.println("next entry, new session created, SESSIONID = " + session.getId()); } else { System.out.println("next entry, no new session created, SESSIONID = " + session.getId()); } } else { System.out.println("First entry, new session created, SESSIONID = " + session.getId()); } // Send resultingpage getServletConfig().getServletContext().getRequestDispatcher("index.html").fo rward(req, res); System.out.println("**** Exit Servlet"); } This is the indexpage: --------------------- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <HTML> <HEAD> <META name="GENERATOR" content="IBM WebSphere Studio"> <TITLE>index.html</TITLE> </HEAD> <BODY> <FORM method="POST" action="TestServlet"> <INPUT type="submit" name="test"> </FORM> </BODY> </HTML> This is the result on console after 'submitting' a couple of times: ---------------------------- [1/23/03 17:04:19:614 CET] 518bb721 SystemOut U WSRU0069I: Applications and modules were successfully restarted. [1/23/03 17:04:41:646 CET] 2446373e WebGroup I SRVE0091I: [Servlet LOG]: TestServlet: init [1/23/03 17:04:41:646 CET] 2446373e SystemOut U **** Servlet reactivated [1/23/03 17:04:41:656 CET] 2446373e SystemOut U First entry, new session created, SESSIONID = IUN33VCPPD3ZK0LT0HK3CWA [1/23/03 17:04:41:686 CET] 2446373e SystemOut U **** Exit Servlet [1/23/03 17:05:12:400 CET] 2446373e SystemOut U **** Servlet reactivated [1/23/03 17:05:12:400 CET] 2446373e SystemOut U next entry, session already active, SESSIONID = IUN33VCPPD3ZK0LT0HK3CWA [1/23/03 17:05:12:410 CET] 2446373e SystemOut U next entry, new session created, SESSIONID = IUN33VCPPD3ZK0LT0HK3CWA [1/23/03 17:05:12:430 CET] 2446373e SystemOut U **** Exit Servlet [1/23/03 17:05:29:385 CET] 2446373e SystemOut U **** Servlet reactivated [1/23/03 17:05:29:385 CET] 2446373e SystemOut U next entry, session already active, SESSIONID = IUN33VCPPD3ZK0LT0HK3CWA [1/23/03 17:05:29:395 CET] 2446373e SystemOut U next entry, new session created, SESSIONID = IUN33VCPPD3ZK0LT0HK3CWA [1/23/03 17:05:29:415 CET] 2446373e SystemOut U **** Exit Servlet
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.