What are Internet Cookies


For a long time, cookies have been a part of the internet. You must have seen a popup on many websites asking you to accept cookies. But what are cookies and why are they so important?

Cookies are small text files that are stored on the user's computer by the browser. They are used to store information about the user and their preferences.

For example, if you visit a website and log in, the website will store a cookie on your browser with some ID that identifies you. The next time you visit the website, the website will read the cookie and know who you are.

what are internet cookies

Note: Sites do not store your password or any other sensitive information in cookies. They only store an ID that identifies you.


How Cookies Work

Cookies play an important role to make the web work and provide a personalized experience to the user.

It works like this:

how cookies work
How Cookies Work

Components of a Cookies

Each cookie has the following components:

components of a cookie
Components of a Cookie

Types of Cookies

There are various types of cookies based on their purpose and characteristics. Some of them are:


First-party vs Third-party Cookies

First-party cookies and third-party cookies are two different types of cookies based on the domain and purpose of the cookie. Here are some of the differences between them:

FeatureFirst-Party CookieThird-Party Cookie
OriginSet by the website you're directly visitingSet by a domain different from the website you're visiting
PurposeEnhance website functionality, personalization, and analyticsTrack user behavior across multiple websites for targeted advertising and marketing
ControlControlled by the website you're visitingControlled by the third-party domain that sets the cookie
Privacy ConcernsLower risk of privacy invasion as data typically remains within the website's domainHigher risk of privacy invasion as data is shared with third-party companies
RegulationSubject to the website's own privacy policy and relevant regulationsSubject to the privacy policies of both the website and the third-party domain
ExamplesSession cookies for login, preference cookies for language, analytics cookiesAdvertising cookies, retargeting cookies, social media buttons

Benefits of Cookies

Cookies have many benefits for both the user and the website. Some of them are:

FeatureUser BenefitWebsite Benefit
Login and Shopping CartsRemember login details and saved items, saving time and effort.Streamline user experience and increase conversion rates.
PersonalizationCustomize website experience based on preferences (language, layout, etc.).Improve user engagement and loyalty.
Targeted Content and AdsSee content and ads relevant to your interests.Optimize advertising campaigns and revenue generation.
Form CompletionPre-fill form fields with saved information.Reduce user frustration and improve data accuracy.
Website FunctionalityEnable features like live chat, video playback, and social media sharing.Enhance website features and capabilities.
Performance AnalyticsTrack website traffic and user behavior for improvement.Improve website design, content, and user experience.

Disadvantages of Cookies

Although cookies are benefitial, they also have some disadvantages. Some of them are:


How to Check Cookies Loaded by a Website

If you are curious to know what cookies are loaded by a website, you can check it in the browser's developer tools.

Here are the steps to check cookies in the browser:

  1. Visit any website.
  2. While on the website, open the developer tool by pressing Ctrl + Shift + i on Windows or Cmd + Option + i on Mac.
  3. Open the Application tab in Chrome or the Storage tab in Firefox.

    chrome cookie storage location
    Chrome Cookie Storage Location
    firefox cookie storage location
    Firefox Cookie Storage Location
  4. Click on Cookies in the left sidebar.
  5. Click on the website name in the left sidebar.
  6. You will see all the cookies loaded by the website.

Cookies vs Local Storage

Local storage is a feature of the browser that allows websites to store data on the user's computer. It is similar to cookies but has some differences.

FeatureCookiesLocal Storage
Storage LimitLimited to around 4KB per domainLarger storage capacity, typically around 5MB to 10MB
Storage LocationBrowserBrowser
ExpirationSet by the websiteNever Expires
AccessibilityCan be accessed by both the client and serverCan only be accessed by the client
SecurityCan be accessed by the website and third-party domainsCan only be accessed by the website
UsageUsed to store user information and preferencesOften used for client-side caching
SecurityProne to security risks (e.g., cross-site scripting)More secure, as it is not sent with every request

Should i Accept Cookies from Websites?

By now you understand the purpose of cookies and how they work. Cookies are not inherently malicious but some cookies are also silent trackers.

So, should you accept cookies from websites? The answer is, it depends on your preferences.

The decision to accept or reject cookies hinges on your privacy concerns and the website's functionality. Some websites may not work properly if you reject cookies but saves you from being tracked.

On the other hand, some websites may work properly even if you reject cookies but you may not get a personalized experience.

The best way to decide is to check the website's privacy policy and decide accordingly.


Conclusion

Cookies are essential for the web to work. They have both advantages and disadvantages.

On one hand, they can be used to enhance the user experience and provide a personalized experience. On the other hand, they can also be used to track user behavior and collect personal information.

You can choose to accept or reject cookies based on your preferences. However, some websites may not work properly if you reject cookies.