Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
  1. User X registers to Panel Y => MirrorImage sets cookie gwid=xyz and logs it
  2. User X opts out on Panel Y => MirrorImage sets cookie gwid=OPTOUT and logs it with cid=c9999
  3. User X visits anything else => MirrorImage notices cookie gwid=OPTOUT and logs it

In other words, MirrorImage would use following logic :

if (optout-request)
  set gwid=OPTOUT
  log gwid=OPTOUT,cid=c9999
else if (gwid==OPTOUT) 
  log gwid=OPTOUT 
else if (new-request-without-cookie)
  set gwid=xyz
  log gwid=xyz
else
  log gwid=xyz

Sample logs:

gwid=xyz       cid=c0047
gwid=OPTOUT    cid=c9999
gwid=OPTOUT    cid=c0061
gwid=OPTOUT    cid=c0064
gwid=OPTOUT    cid=c0047
gwid=OPTOUT    cid=c0066
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment