Internet Cookie


Hear the Cookie so many time do not share your cookie with anyone but you already never share your cookie with anyones already ๐ good but on the internet world also you should also never share the your cookie to anyone mean to other site. So lets know first what it is
What is Cookie?
Cookie are small text to value Set-Cookie: = <cookie-name>=<cookie-value>
date store on the user/client side which helps the server to know about the user and set the preference Cookie is store on the user/client browser.
Why we need Cookie on first place?
So think what we if donโt use cookie so the server send a web page to the browser and connection lost and when again browser connect with the server. So two problems occurs.
The server donโt know nothing about the user as it not store on its side also cookie we do not using right now show the generic page
Now the server have to store all the info about user store on his side which will require space and think if server have to store the info of 100K user that a very big data and that also increased the load that not the optimal way to use the server for.
And to solve problems these problems Cookies is invented "how to remember information about the user and store on the browser":
user info store in the cookie his perfirences, name , id, session Token, settings sometimes.
This will offload the server load and server use cookie to show data related to user set settings for user and analysis the data for best result and analysis.
How much data can be store in Cookies?
One can things we can store all about the user in the browser it will save the server load and also save the call server to database but as you guess its not good.
Cookies are send with every request so if we sending all the data by in each request that make the request too big and one with slow internet have to wait very long.
I think you guess storing the data on the browser take the user side space and if each site store on the user side. Then the user computer is the database in some term ๐ช ๐.
So 1st we cannot store all the data on the user side and 2nd the browser provide the limited no of cookies a domain have with each have a max size per cookie is 4KB.
Subscribe to my newsletter
Read articles from Hemant Kumar directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

Hemant Kumar
Hemant Kumar
๐ Hi , I'm Hemant Kumar aka MrBlackGhost ๐ I'm a Fullstack Developer focused on building modern, responsive web apps using React, Next.js, Tailwind CSS, and Node.js.Currently deepening my knowledge in AWS, GraphQL, and backend architecture. ๐ญ Working on: A smart "Read Later" app for saving articles, tweets, and videos ๐ฑ Learning: AWS, Django (Python), CI/CD pipelines ๐ ๏ธ Tech I use: React, Next.js, Tailwind, Node.js, PostgreSQL ๐ Currently diving into: Cloud computing and system design ๐ฎ Fun fact: I skate in the morning and game in the evening (God of War fan ๐พ) ๐ซ Reach me: LinkedIn | Twitter