The difference is as follows: When you say getSession(true), this method will check whether already a session is existing for the user. If a session is existing, it will return that session object, otherwise will create a sessin object explicitly and return to the cilent. When you say getSession(false), this method will check whether a session is existing. If yes, then it returns the reference of that session object, OTHERWISE IT WILL RETURN 'null'. Hope this is clear.