By Rishabh Ranjan Jha on 2021-08-16 05:59 in GSoC 21 Feature Enhancement - 2

Date: 9 August 2021 - 15 August 2021

Location: Glip

Hi, this is the progress report for the cookie manager project which is currently part of GSoC.

In the 10th week of the program, we implemented the cookie consents functionality in the plugin.

Tasks completed this week:

  • Cookie consents stored in cookiemanager_consents database table.
  • UUID generated using bin2hex(random_bytes(16)) and set as a cookie to identify a unique user.
  • CCUUID generated using bin2hex(random_bytes(32)) and set as a cookie to identify the consents given for a particular user.
  • Consent Date generated using JavaScript Date() function.
  • User-Agent of the browser generated using $_SERVER[‘HTTP_USER_AGENT’].
  • URL generated using window.location.href.
  • Cookie consent data is sent through AJAX from frontend to backend with the following fields:
    • UUID
    • Consent Date
    • URL
    • Consent Opt-in
    • Consent Opt-out
  • In the backend, first, decode the JSON string and add two more fields to the object, namely CCUUID and User Agent of the browser.
  • Insert this object with consent data to the database using insertObject() function.
  • And in the AJAX response, send back the CCUUID to print it on the cookie settings banner in the frontend.
  • In the banner, add three fields:
    • Consent Opt-in
    • Consent ID (CCUUID)
    • Consent Date


Pull Request -