If a machine is shared by multiple users, how can you update a user's audience on log in and then clear it on log out?
In our example, we target a banner in our logged in app to an audience A.
A user, who qualifies for audience A, logs in and sees the Target banner in the app.
That user logs out, but does not close the browser window.
In the same session, a user, who does not qualify for audience A, logs in and also sees the Target banner in the app.
This is the wrong behavior.
How should I set up targeting so that ONLY users who qualify for an experience because of their log-in information see a Target experience? When the user logs out, that qualification should be forgotten.
Two+ users on a single device and therefore same Target profile can be a little tricky as your noticing. Profile parameters (the stuff under "visitor profile" when setting up audiences) are sticky to the profile and can't be "cleared" like your wondering about. They can be updated/overwritten though. Alternatively, you could target off of mbox parameters (aka custom parameters). These parameters are unique in that they do not persist. They are only used for that request and then are forgotten.
So pass your targeting conditions to Target as custom parameters and use those in your audience definition. For example, if you want to target someone who is 1) logged in, and 2) not subscribed to the newsletter. Pass those to attributes on every applicable request to Target. Using targetPageParams() it might look like this: