request.getSession() will return a current session. if current session will not exist the it will create a new one.

request.getSession(true) will return current session. If current session will not exist then it will create new session.

So basically there is not difference between both method.

request.getSession(false) will return current session if current session will not exist then it will NOT create new session.

Comments are closed.