- Cookies allow servers to identify repeat visitors and customize websites by storing small amounts of data on a user's device. They help enable e-commerce sessions and avoid requiring usernames and passwords. However, they also raise privacy concerns if sensitive personal information is stored in cookies or they are shared across sites.
- Cookies are created and sent by servers using the addCookie method and stored by browsers. On subsequent requests, browsers return cookies to servers which can then be retrieved using the getCookies method. Cookies have attributes like names, values, expiration times and paths.