getButterfly Logo getButterfly code wrangling since 2005

What are they?

A very small text file placed on your hard drive by a web page server when you access a site on that server. It serves as an identification the next time you access web pages on that server so as to extend the capabilities of web-based client/server applications. It is uniquely yours and can only be read by the server that gave it to you.

What are they for?

To let the server know that you have returned to a page/site you have previously visited. This can be useful in the following situations:

  • Suppose you are filling a form and then accidentally close the window. A cookie set on your machine lets the server remember fields already filled-out.
  • Allows you to customize what you want to see when you visit a portal like
  • Monitors which advertisements were shown to you and how often each was shown.

Types of cookies

There are two types:

  1. Session cookies – expire after your session on that site
  2. Persistent cookies – remain until you clear your cache and delete cookies

Types of values a cookie can pass

  • The name of the cookie.
  • The value of the cookie.
  • The path of the cookie is valid for – the URL path the cookie us valid in. Web pages outside of that path cannot use the cookie.
  • The expiration date of the cookie – how long the cookie is active in your browser.
  • The domain the cookie is valid for – makes the cookie accessible to pages on any of the servers on a multi-server domain.
  • The need for a secure connection – states if the cookie can only be used on a secure server connection, such as on a site using SSL.

Read more here.

Subscribe to getButterfly Blog

Once a week or so we send an email with our best content. We never bug you, we just send you our latest piece of content.

If you found any value in this post, agree, disagree, or have anything to add - please do. I use comments as my #1 signal for what to write about. Read our comment policy before commenting! Comments such as "Thank you!", "Awesome!", "You're the man!" are either marked as spam or stripped from URL.

One thought on “Cookies Overview

Leave a reply