Skip to main content

Disabling cookies

If you have chosen opt-in or opt-out as your compliance type, you will need to disable cookies on your site depending on the user action.

Diabling cookies should be done with the callback hook:
onInitialise: function (status) {
  var type = this.options.type;
  var didConsent = this.hasConsented();
  if (type == 'opt-in' && didConsent) {
    // enable cookies
  }
  if (type == 'opt-out' && !didConsent) {
    // disable cookies
  }
},
 
onStatusChange: function(status, chosenBefore) {
  var type = this.options.type;
  var didConsent = this.hasConsented();
  if (type == 'opt-in' && didConsent) {
    // enable cookies
  }
  if (type == 'opt-out' && !didConsent) {
    // disable cookies
  }
},
 
onRevokeChoice: function() {
  var type = this.options.type;
  if (type == 'opt-in') {
    // disable cookies
  }
  if (type == 'opt-out') {
    // enable cookies
  }
},

Brought to you by Insites

This website was created with love by Insites. We hate the stupid cookie law, and decided that if we had to comply with it, we may as well create a solution that doesn’t suck.

Insites helps organisations test and improve their websites. Learn more about us