How do we use the session to share attributes between portlets deployed as individual WARs?
Overview: All portlets (both in the Liferay EAR and deployed as individual WARs) are able to share attributes using the default HttpSession object using 2 different methods NOTE: If all portlets are packaged in the same WAR, those portlets will share the same session, but they will have a different session than the portal since the portal is in its own WAR. Method 1 – Sharing attributes between portlets: This method involves giving portlets access to the portal’s session. Namespacing is not used in this method. This method is desirable for most scenarios, however there is the potential for a portlet to overwrite another portlet’s (or even the portal’s) attributes being stored in the session. For example, suppose after a user logs in, the portal sets an object called “user” in the session. If one of the portlets were also to set an object called “user” in the session, the previous “user” object would be clobbered.