We’ve all been harassed with the following request:

This website uses cookies … Please accept to continue

Oh yeah!

Cookies are data that are collected from websites that you visit and are stored on your own computer so that when next you visit that same website, the website remembers who you are, what your preferences are, what you have in your cart, etc.

Cookies are part of the http protocol which most applications have come to rely on, and which sadly can also be subject to exploitation.

Cookies enable servers to send items of data to the client, which the client stores and resubmits back to the server. Unlike the other types of request parameters (those within the URL query string or the message body), cookies can also be resubmitted in each subsequent request without any particular required interaction with the user or the application itself.

Cookies consist of a name/value pair, but they can also consist of any string that does not contain a space. Multiple cookies can be issued by using multiple Set-Cookie headers in the server’s response, and are all submitted back to the server in the same Cookie header, with a semicolon separating different individual cookies.

In addition to the cookie’s actual value, the Set-Cookie header can also include any of the following optional attributes, which can be used to control how the browser handles the cookie:

  1. expires — This is used to set a date until which the cookie is valid. This will cause the browser to save the cookie to persistent storage, and it will be reused in subsequent browser sessions until the expiration date is reached. If this attribute is not set, the cookie will only be used in the current browser session.
  2. domain — This is used to specify the domain for which the cookie is valid. This must be the same or a parent of the domain from which the cookie is received.
  3. path — This is used to specify the URL path for which the cookie is valid.
  4. secure – If this attribute is set, then the cookie will only be submitted via HTTPS requests.
  5. HttpOnly — If this attribute is set, then the cookie cannot be directly accessed via client-side JavaScript, although not all browsers support this restriction.

Cookies are not inherently bad in themselves, but the attributes set on a cookie can seriously impact the security of the application and make it vulnerable to malicious attacks.

Recent Posts

Google Announces that AI-developed Drug will be in Trials by the End of the Year

Isomorphic Labs, a drug discovery start-up launched four years ago and owned by Google’s parent…

14 hours ago

Instagram Extends Reels Duration to 3 Minutes

Regardless of whether TikTok faces a U.S. ban, Instagram is wasting no time positioning itself…

3 days ago

AWS Expands Payment Options for Nigerian Customers, Introducing Naira (NGN) for Local Transactions

Amazon Web Services (AWS) continues to enhance its customer experience by offering more flexible payment…

6 days ago

Why JavaScript Remains Dominant in 2025

JavaScript, often hailed as the "language of the web," continues to dominate the programming landscape…

1 week ago

Amazon Moves to Upgrade Alexa with Generative AI Technology

Amazon is accelerating efforts to reinvent Alexa as a generative AI-powered “agent” capable of performing…

1 week ago

Smuggled Starlink Devices Allegedly Used to Bypass India’s Internet Shutdown

SpaceX's satellite-based Starlink, which is currently unlicensed for use in India, is reportedly being utilized…

1 week ago