While working on
MAGNOLIA-2245, previewMode is being moved from info.magnolia.cms.util.Resource to AggregationState.
Given the InterceptFilter is setting this flag, and uses the session to do so, it seems we could use a cleaner implementation.
Using the session is somehow still needed, for instance to serve resources / images appropriately.
One of the things that bother me with the current implementation is that gui components access the aggregation state freely (global state) - this c/should instead be passed to the output methods.