0

I am working on website where user can accept or reject cookies. So website should save cookies only if user allow. But when website loads I can see 3 cookies already saved as shown in picture below

enter image description here

These are dependencies saved in package.json

    "@emailjs/browser": "^3.11.0",
    "@react-google-maps/api": "^2.18.1",
    "@testing-library/jest-dom": "^5.16.5",
    "@testing-library/react": "^13.4.0",
    "@testing-library/user-event": "^13.5.0",
    "dotenv": "^16.0.3",
    "env-cmd": "^10.1.0",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-icons": "^4.8.0",
    "react-router-dom": "^6.14.1",
    "react-scripts": "5.0.1",
    "react-toastify": "^9.1.3",
    "web-vitals": "^2.1.4"

Can you please guide me how I can stop these cookies to be stored without my permission in my react project?

kiranvj
  • 32,342
  • 7
  • 71
  • 76
Zohab Ali
  • 8,426
  • 4
  • 55
  • 63
  • 2
    Your picture 1. is a _picture_ and 2. doesn't show any cookies. – jonrsharpe Jul 17 '23 at 11:19
  • What do you see when you expand the `cookies` directory in the picture. – kiranvj Jul 17 '23 at 11:22
  • The @emailjs/browser package seems to be responsible for setting the cookies. – Wakil Ahmed Jul 23 '23 at 11:09
  • Make separate sections for essential and optional cookies. Essential ones will be needed for proper functioning of site (like auth, settings, etc) and will need to be enabled, optional can include ads, tracking, etc for which you can take user consent and use the method described by Ali in his answer – Prince Agrawal Jul 24 '23 at 09:40

0 Answers0