Skip to content

Instantly share code, notes, and snippets.

@l15k4
Last active February 10, 2017 10:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save l15k4/5e817ece104c81f59d91d6f02edf690f to your computer and use it in GitHub Desktop.
Save l15k4/5e817ece104c81f59d91d6f02edf690f to your computer and use it in GitHub Desktop.
  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