DEV Community

Ashomondi
Ashomondi

Posted on

COOKIES

Cookie: How website remember us

During a TED Talk I led a session on one of the most important but often ignored parts of the internet- cookies. Many people hear the word "cookie when browsing or they may see it and still ignore it yet they don't know how they work behind the scenes.

What Are Cookies?
Cookies are small data stored in your browser to help the website to remember information about you.
Since websites cannot naturally remember visitors after page refresh, cookies act 4like a memory tool between the browser and the server.
For example, when you log into a website and remain signed in even after refreshing the page, cookies are usually responsible for that experience.

How cookies work

Cookies work through communication between a web browser and a web server.
The process is simple:

  1. A user visits a website ,(search any kind of website)
  2. The user inputs his/her credential like : password, username/email.
  3. These credentials are sent to the database for verification.
  4. After verification a session is created with a unique ID called session ID.
  5. The website creates a cookie containing information as a session ID or user preference.
  6. The cookie is stored in the browser.
  7. Every time the user revists the website, the browser sends the cookie back to the server.
  8. The server reads the cookie and recognizes the user. This allows websites to provide personalized experience without asking users to log in repeatedly.

For example,

  • Online stores remember items in a cart.
  • Social media platforms keep users logged in.
  • Websites remembers language or theme preferences. Without cookies, users would have to re-enter information on every page they visit.

Types of cookies

During the session, I explained that cookies are divided into different types depending on their purpose.

1. Session cookie

Session cookies are temporary that only exist when the browser is still open , once the browser is closed the cookie expires automatically.

They are mainly used for :

  • 1. Keeping users loigged in during one session.
  • 2. Temporary website activities.
  • 3. Navigation between pages.

Persistence cookie

This cookie remain stored for a longer period of time maybe weeks or months even after the browser is closed.

They are mainly used for:

  • Login details.
  • User preferences.
  • Frequently visited settings.

3. Third-Party cookie

Third-party cookies are created by external companies such as advertisers or analytics services instead of the website itself.

They are mostly used for:

  • Tracking browsing behavior
  • Showing targeted advertisements
  • Collecting website analytics

These cookies are the main reason privacy concerns around cookies exist today.

Why cookies are important

Cookies make the internet faster, easier, and more personalized. They improve user experience by helping websites remember useful information.

However, cookies also collect data about user activity. Some websites use this information responsibly, while others may use it for aggressive advertising and tracking.

This creates an important conversation about privacy, data security, and digital awareness.

Privacy and security concerns

One major topic discussed during the TED Talk session was how cookies can affect privacy.

If not properly protected, cookies can:

  • Be used to track user activity online
  • Store sensitive information
  • Become targets for hackers
    Modern websites now use security measures such as:

  • Encrypted HTTPS connections

  • Secure cookies

  • Cookie consent notices

  • Privacy settings for users
    Many browsers also allow users to block or delete cookies whenever they choose.

Conclusion

Cookies may seem small, but they are essential to how the modern web works. They help websites remember users, maintain sessions, personalize content, and improve browsing experiences.

At the same time, they raise important questions about privacy and data tracking. Understanding how cookies work helps users become more informed and responsible internet users in today’s digital world.

Top comments (0)