Example & Tutorial understanding programming in easy ways.

What the difference is between getSession (true) and getSession (false)?

The getSession(true) will check whether a session already exists for the user or the request. If yes then, it will return that session object else it will create a new session object and return it.

On the other hand, the getSession(false) will check existence of session. If session exists, then it returns the reference of that session object, if not, this methods will return null.

Read More →