Cookies: What They Are, How to Create and Read Them (Part 1)

Giovanni Pace

Description

I'll explain what Cookies are in Java Servlets, how they work in the HTTP protocol, and what they're used for to maintain state between stateless requests. We'll see how to create a cookie with new Cookie(name, value) server-side, set its duration with setMaxAge(), and read it in subsequent requests.