This repository has been archived by the owner on May 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cookie_type.js
74 lines (58 loc) · 4.17 KB
/
cookie_type.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
// //distinguish cookies by their name and expiration date
const sqlite3 = require('sqlite3').verbose();
let sql = 'SELECT * FROM cookies ORDER BY name';
const decryptor = new cc.ChromeCrypt();
// /****** Session Cookies ****/
// //Usually if that name has "Sess" or "id" indicates a session cookie
// //Examples
// //name = __cfduid indicates a cloudfare cookie. Expires after 30 days
// | .utexas.edu | __cfduid | ddcdfdc9f05162349b842329b78de709c1547688113 | // https://support.cloudflare.com/hc/en-us/articles/200170156-Understanding-the-Cloudflare-Cookies
// //name = __utmb, utmv indicates a google analytics cookies. Expires after 30 minutes
// | .geeksforgeeks.org | __utmb | 245605906.1.10.1568151135 | //https://www.optimizesmart.com/google-analytics-cookies-ultimate-guide/#a24
// | .slideshare.net | __utmv | 186399478.|1=member_type=LOGGEDOUT=1 |
// /****** Tracking Cookies ****/
// //Examples
// //name = _ga indicates a google analytics cookie. Expires after 2 years
// | .skyscanner.com | _ga | GA1.2.1196117874.1556671497 | //https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage
// //name = __qca indiates a quantcast cookie, which is a marketing company
// | .soundcloud.com | __qca | P0-108408777-1547699109119 | //https://webmasters.stackexchange.com/questions/17912/what-does-the-quantcast-qca-cookie-do
// //name = __utma, __utmz indicates a google analytics cookie (unique visitor cookie). Expires after 2 years
// | .calculator.net | __utma | 9212199.612212910.1547564371.1550795609.1554246103.3 | //https://www.optimizesmart.com/google-analytics-cookies-ultimate-guide/#a24
// | .simplypsychology.org | __utmz | 174296480.1553568244.1.1.utmcsr=google|utmccn=
//name = _gcl_au indicates a google analytics cookie (conversion linker). Expires after 2 years //https://support.google.com/tagmanager/thread/6211471?hl=e
const rowModule = require('./read_db.js')
// const sqlModule = require('./read_db.js')
var rows = rowModule.rows
// var sql = sqlModule.sql
rows.forEach((row) => {
console.log("|", row.host_key.padEnd(30), "|", row.name.padEnd(20), "|", decryptor.decrypt(row.encrypted_value), "|");
});
db.all(sql, [], (err, rows) => {
if (err) {
throw err;
}
rows.forEach((row) => {
console.log("|", row.host_key.padEnd(30), "|", row.name.padEnd(20), "|", decryptor.decrypt(row.encrypted_value), "|");
if(row.host_name === "_ga") {
// console.log("|", row.host_key.padEnd(30), "|", row.name.padEnd(20), "|", decryptor.decrypt(row.encrypted_value), "|");
// row.type = "Tracking ( Google Analytics)";
// row.expire = "date here - +2 years";
// row.description = "Used to distinguish users"
// row.link = "https://developers.google.com/analytics/devguides/collection/analyticsjs/cookie-usage"
}
else if(row.host_name === "__cfduid") {
// console.log("|", row.host_key.padEnd(30), "|", row.name.padEnd(20), "|", decryptor.decrypt(row.encrypted_value), "|");
// row.type = "Session (Cloudfare)";
// row.expire = "date here - 30 minutes";
// row.description = "Used by the content network, Cloudflare, to identify trusted web traffic"
// row.source = "https://ailab.criteo.com/cookie-declaration/"
}
else if(row.host_name === "__qca") {
// console.log("|", row.host_key.padEnd(30), "|", row.name.padEnd(20), "|", decryptor.decrypt(row.encrypted_value), "|");
// row.type = "Tracking (Quantcast)";
// row.expire = "date here - +2 years";
// row.description = "Used by the Marketing firm, Quantcast, to compile and report user data to third-party companies"
// row.source = "https://www.quantcast.com/about-us/"
}
});
});