8

The Question

How can my website webapp detect that a XPM preview session is active and the Session Footprint Set is feature overwriting ADF claims?

A possible solution

When the Footprint Set feature overwrites claims set by the cartridge there is no API call available to see that this is actually happening. I have found that the XPM sets a TAFContext.1 cookie when in Footprint Set mode. I am wondering if this a good way to detect XPM is overwriting cookies, maybe there are better options.

Context

enter image description here

The reason why I want to know is because I need my cartridge to clean up claims after the Footprint Set is disabled (user selected the "No Footprint Set Applied"). XPM does not restore the overwritten claims but keeps the claims to the whatever value it was overridden to. This is fine for claims which are set on every request but claims which have a high cost (i.e. call to backend) typically are set only once.

2

Here is a partial answer how to verify if Session Preview is active. The example is from a 2011SP1 implementation but it may work or at least you get the drift:

ClaimStore claimStore = AmbientDataContext.CurrentClaimStore;
if (claimStore != null && claimStore.GetAll().Any(a => a.Key.Equals("taf:claim:contentdelivery:webservice:preview:sessionid"))) {
    // Session Preview is true
}

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.