Sorry..Sorry...
Ulf Dittmer wrote:Actually, getSession does both - creating and getting a session, depending on the circumstances. Its javadocs explain that.
Exactly
getSession(boolean create)
Returns the current HttpSession associated with this request or, if there is no current session and create is true, returns a new session.
in case of JSP request container creates one implicitly