JSP: new Session created on every access of page

From: Joe Randstein (javawocky_at_hotmail.com)
Date: 11/29/03


Date: 29 Nov 2003 06:45:49 -0800

Hi!
I have a little problem with my JSPs. A new session is constructed
every time the page is accessed, sure it is not working that way, as I
can't store any data that way.

I developed the code at home on Windows/Tomcat4.0.6 and it worked as
it should, but when I deployed it on a Linux server the problem
started. Every time the session has a new ID, isNew() responds with
true.
>From my observation the browser isn't getting a cookie, so it
obviously can't send back the cookie the next time it accesses the JSP
and that should explain why a new session is created every time.
But handcrafted cookies work on the Linux server and Browser, I tested
that. But I wanted to use the session API and not do the work by hand.

Does anybody have an idea what can be wrong? Is there a parameter I
can check? Or a check in the tomcat config?

Thank you very much for your responses



Relevant Pages

  • Re: How to re-use existing classes in JSP/JavaBeans/Servlets
    ... I want to instantiate them and have the instance ... so the lifecycle is that of the client session. ... Process all data that comes in a HTTP request within a servlet -- they're ... are a good match with JSPs, and JSPs are good for creating HTML views. ...
    (comp.lang.java.programmer)
  • Re: JSP: new Session created on every access of page
    ... > I have a little problem with my JSPs. ... A new session is constructed ... but when I deployed it on a Linux server the problem ... > obviously can't send back the cookie the next time it accesses the JSP ...
    (comp.lang.java.programmer)
  • Caching von JSPs
    ... Ich habe mehrere JSPs, ... Es soll zwischen den Seiten gewechselst werden, ohne dass der Inhalt der Inputfelder verloren geht. ... Bis jetzt wird bei jeden Wechsel mit JS alles ausgelesen und in die Session geschrieben und dann beim Aufruf wieder mit EL reingeschrieben. ...
    (de.comp.lang.java)
  • Re: servlet problems with session attributes
    ... I use session attributes to to preserve data across the session and to comunicate across servlet objects. ... The only way I can clear this ArrayList is to restart the Tomcat container! ... If I understand correctly it should be one or two jsps and one or two servlets. ...
    (comp.lang.java.programmer)
  • Re: session wont timeout
    ... Maybe this is a session cookie issue? ... client browser there is this one: WSS_KeepSessionAuthenticated Expires: At ... If I kill the session cookie using IE Developer Toolbar, ... possible and IIS would throw another challenge. ...
    (microsoft.public.sharepoint.windowsservices)