From CISO Marketplace — the hub for security professionals Visit

Cookie

Data Protection

Definition

Small website file storing user preferences and session data.

Technical Details

Cookies are small pieces of data sent from a server and stored in a user's web browser while browsing a website. They are used to remember information about the user, such as login credentials, shopping cart contents, and user preferences. Cookies can be classified into session cookies, which expire once the browser is closed, and persistent cookies, which remain on the user's device until they expire or are deleted. Cookies can also have attributes like 'Secure', which ensures they are only transmitted over HTTPS, and 'HttpOnly', which prevents access to the cookie via JavaScript, enhancing security against XSS attacks.

Practical Usage

Cookies are widely used in web applications to enhance user experience by remembering user preferences and maintaining session states. For instance, when a user logs into a website, a cookie can be created to keep them logged in during their session. Additionally, e-commerce sites use cookies to track items in a shopping cart even if the user navigates away from the page. Cookies are also utilized for analytics purposes, helping website owners understand user behavior and improve site functionality.

Examples

Related Terms

Session Management Web Tracking HTTP Headers Data Privacy Cross-Site Scripting (XSS)
← Back to Glossary