hi, i have a problem, such that the session id changes on the way from one page,servlet to another. cookies are enabled. there should be no problem. by the way, i am using tomcat 4... when I first create a session, use: request.getSession(true); and later just use request.getSession(false); -->then get problems. null objects etc. isSessionfromCookie returns always false.... why might this happen? [ August 28, 2003: Message edited by: R�stem e Zal ]
jeah, cookies are enabled... i have a proposal. Since session info is somehow transferred over Cookie. i made a short investigation over the forum.java.sun.com and got this: the cookie is transferred only to those directories: at the same level or below the directory from which the cookie was sent to the client... ex. if i have www.xyz.com/login_page.jsp ---> /servlet/MyServlet1 which implicitly does some processing(checks login name password) (creates session here) and redirects to ---> /jsp-pages/page2.jsp if password ok, or back to page1.jsp o.w. does any of you have any idea? [ August 28, 2003: Message edited by: R�stem e Zal ]
Author and all-around good cowpoke
Joined: Mar 22, 2000
Possibly the way your pages are organized in directories, the servlet engine thinks you have more than one "web application" Also, if you are using the /servlet/xxxx nomenclature it goes through the "invoker" servlet so the association with the other parts of your "web application" may not being made. Tell us more about how your directories under /webapps/ are laid out. Bill
/myappln/index.html--> /myappln/jsps/jsp1.jsp --> /myappln/Servlet1 (deployment descriptor defined) --> /myappln/Servlet2 --/myappln/jsp2.jsp ..... session is created first in jsp1.jsp in Servlet1, but inside Servlet1 the id has changed strangely, and the attribute I have put while inside jsp1.jsp has disappeared. also from S1-->S2 the id changes again. -->and so on to jsp2.jsp ANOTHER Strange issue: i write sometimes values to the console, they are printed twice.. thanks in advance.
No, nowhere session.invalidate(); being used... actually this is an appln with about 10 servlets 5 beans, 4 tags, and 15 jsps , + htmls css image files.. and the whole appln was working ok till last week. but since 2 days ridicuolously has this problem. i am still testing it.. is it related with tomcat? i dont know.
ANOTHER Strange issue: i write sometimes values to the console, they are printed twice..
Check whether some where in your JSP you have submitted twice.
Joined: Nov 22, 2008
Session object is same for the same session id for a client.
Joined: Nov 22, 2008
Hi guys, finally solved the issue... when the form is at the beginning submitted, somehow the Tomcat engine interpretes it as two different submissions. I rebooted the computer; now still it has two submissions. but the session issue has been working properly. Regards...