My application has a JSP that creates a user object, stores it in the session, then displays a list of hyperlinks to other JSPs. When the user clicks on a hyperlink, a new JSP is called and a different session is created.
In a nutshell, a session object is created for each entry point into the application.
Using model 1, many sessions are created since there are many entry points into the application.
Using model 2, only one session is created since there is only 1 entry point into the application.
Originally posted by William Brogden:
There is no inherent reason for session tracking not to work in model 1 or 2. Note that sessions are only shared within a servlet context == web application. If all of your jsp and servlets are in the same web application they should be able to share a session.
I guess that's good news, but that's makes my bug even more odd. In the process of debugging, I displayed the jSessionID of each JSP and they are different.
Did I mention that when each hyperlink is clicked, a new browser is spawned? Perhaps some URL rewriting is in order....