4

I am trying to update user information in a "Edit Profile" page and while I do save changes into the Audience Manager database using the AM API, the AM claims are not updated. It seems that the AM claims are read only, I cannot overwrite profile extended details claims from code. Therefore how to display the appropriate user details on every page after a profile update has occurred, without forcing the user to logout and login again?

Also, how to cleanup AM claims properly during logout? At the moment even logging out and then logging in again still uses old profile claims information which remain in the ADF cookie. Should I delete the cookie as part of the update profile process? It sounds a bit drastic.

Update 1:

Thanks Peter I am now able to logoff correctly by deleting all AM claims + the internalcontactid claim. Calling contact.IdentifyAsCurrentVisitor() indeed works nicely when logging in as a different user.

So far, I am still not able see the updated claims when changing profile details in a page. Logging off and on again with the same user still shows old claim values, despite deleting all the claims and calling IdentifyAsCurrentVisitor() upon login. I am also calling contact.IdentifyAsCurrentVisitor() right after contact.Save(), is this ok? It does not seem to help anyway.

Update 2:

Adding the ADF claim "taf:cartridge:audiencemanager:invalidatecache" upon profile change, as suggested by Peter, works like a charm! All claims are updated during the following request as expected. Thanks a lot Peter.

1
  • I've added an edit to my answer that covers caching, which is fairly new. Commented Jun 28, 2016 at 6:42

1 Answer 1

1

It depends a bit on how you've implemented it (we support older mechanisms for identifying a Contact for customers who upgraded). But assuming this is on a new implementation:

The cartridge clears the data on every request, so you just need to make sure to update the Contact ID when logging out and/or logging in as someone else.

It doesn't sound like you are using contact.identifyAsCurrentVisitor() after logging in. You should. It's the easiest way to update the Contact data in the current session.

When logging out, you would then need to clear the ADF session claim with the following URI: taf:claim:tracking:internalcontactid

It's also possible that you might have set another ADF session claim called "taf:claim:audiencemanager:contact:id". If so, clear that one too when logging out.

Edit: I forgot to mention that, since you're on Web 8, there's a cache for the Contact data too ("CacheDuration" setting in cd_audience_manager_conf.xml). To clear the cache, you can add an ADF claim called "taf:cartridge:audiencemanager:invalidatecache" (any value will do, it just checks if it exists). This gets added automatically when you save a Contact, but not when you just log in as someone else.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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