Layout template locations are stored in the portlet session. This has probably been introduced to increase performance of template localization. In some usecases different PSML fragments use the same ID, but with different viewpage preferences. In these cases the different fragments share the same viewpage, namely the viewpage of the first fragment that is rendered.
This patch will make the caching of templates in the portlet session optional through a Jetspeed property. The default behaviour will remain the same: templates are cached in the portlet session.