Question: what is the difference between using getsession(true) and getsession(false) methods?
Answer: getSession(true) will return current session. If current session does not exist, then it will create a new session. So basically there is not difference between both method. ... getSession(false) will return current session if current session exists.