Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

JavaScript jQuery Basics (2014) Creating a Simple Lightbox Preparation

What are cookies and Cache?

I've been hearing those terms for so long... What are those things???

1 Answer

Steven Parker
Steven Parker
231,275 Points

Every padawan knows these are the temptations of the dark side. :smiling_imp:

Just kidding.

"Cookies" are data chunks passed to your browser from a server and stored locally on your machine. Then, in subsequent requests to the same server, they are sent back along with the request data. This provides a mechanism to overcome the "stateless" nature of HTTP and provide context to subsequent communications. One common use of cookies is to retain user identification. Cookies can persist through different browser sessions.

The "Cache" is temporary storage in your browser of web resources like images, sound clips, and even entire pages. This allows the browser to respond much faster if the same resources are required again during the session. Unlike cookies, the cache is generally not stored for use between different sessions.