UNPKG

my-security-package1

Version:

A security package providing various utilities for IP detection, device fingerprinting, bot detection, cookie duplication checking, country verification, and VPN detection.

12 lines (10 loc) 465 B
function checkCookieDuplication(cookieName) { const cookies = document.cookie.split('; ').map(cookie => cookie.trim()); // Check if at least one cookie with the specified name exists const hasCookie = cookies.some(cookie => { const [name] = cookie.split('='); return name === cookieName; // Check if the name matches }); return hasCookie; // Return true if cookie is found, else false } module.exports = checkCookieDuplication;