Websites - Cookies vs Sessions: Which are the pros and cons of using them

in #blog2 years ago

For anyone who has worked with Web development, cookies and sessions are part of any project. But cookies and sessions are more than that. Are two concept which are known to a lot of people, not only developers but also users of various platforms.

Both Cookies and Sessions have the same concept and idea on how to and why to use them

The idea between cookies and sessions is simple. We have some data, most of the cases user data that we need to save them and to use them in entire site, whenever we need them.

Cookies - Pros

  • Easy to use
  • Can be personalise
  • You can determine time of usage between user visits

Cookies - Cons

  • Security - Can be compromised easily
  • Privacy Issues

Sessions - Pros

  • Can be used for sensitive data not like cookies
  • Kept on Server Side

Sessions - Cons

  • Cannot be personalise like cookies
  • Expire easily when user closes the browser

Photo by Christopher Laberinto on Unsplash

Although Cookies and Sessions can be seen and used as same thing there is a big difference between them. Cookies are stored in Client Side (User Machine/Browser), while Session are stored in Server Side.


Good post

👍I like your post