Explain the difference between boolean parameter passed to method getSession() as getSession(true) and getSession(false)?

Solution

getSession(true) – When you call this method to get session, this method will check whether a session already exists for the user and returns the session and if the session does not exists it will create new session object and return that object.

getSession(false) – When you call this method to get session, this method will check whether a session already exists for the user and returns the session and if the session does not exists it will return null.

Share this thread

Comments

Comments
comments powered by Disqus

Navigation

Social Media