Skip to content

Instantly share code, notes, and snippets.

@maxvolovikov
Created December 13, 2018 19:53
Show Gist options
  • Save maxvolovikov/f60e0ca63f173351b728c4877dfa3b4f to your computer and use it in GitHub Desktop.
Save maxvolovikov/f60e0ca63f173351b728c4877dfa3b4f to your computer and use it in GitHub Desktop.
Cookies General
- pieces of info stored in users browser referencing previous sessions on the website/ in app saves
- different data: authorization, shopping cart, completed form fields, personalization…
- third parties cookies is a Non-related tracking info and is a privacy concern
Origin
- Louis Montulli
- patented in 98 no consent was required at first.
- Original goal to keep shopping card stored Not on the server but on client side
Session Cookie
- in memory
- Cleared on browser close
Persistent Cookie
- Expires on a set date
- Used to track browsing history
Secure Cookie
- HTTPS only
- Has secure flag
HTTP only cookie
- Helps to defeat XSS
- httpOnly flag
- Not accessible by javascript
Same site cookie
- To help with XSRF
- 2016 Google
3rd Party Cookie
- Used by advertisers to track browsing history and to serve relevant ads
Supercookie
- Normally blocked by browser
- Potential user impersonation
- Set by top level domain like .com
Zombie cookie
- Stored in multiple locations
- Recreated after it is deleted
Structure
- Name
- Value
- Options (name:value)
- Attributes
- Domain & path: Can only set current top domain and not some other for security purposes
- Expires & Max-Age
- Secure & HttpOnly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment