Here is the sample example using login form that explains how to use PortletSession in liferay. In general PortletSession has default scope limited to Portlet which can be extended to APPLICATION_SCOPE by changing property.
Let us understand it using Login example.
Let us understand it using Login example.





