Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
215,956 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.