Skip to content

Instantly share code, notes, and snippets.

@BobGu
Last active August 29, 2015 14:05
Show Gist options
  • Save BobGu/96cf0e3fc101740d6ffc to your computer and use it in GitHub Desktop.
Save BobGu/96cf0e3fc101740d6ffc to your computer and use it in GitHub Desktop.
1. What's the difference between a cookie and a session?
A cookie is a marker that connects to the session, and had some stringfied data typicall in a JSON type object, Session is a domain concept.
2. What's serialization and how does it come into play with cookies?
Is stringifying an object, then it turns your object into strings
3. Can a cookie be shared by more than one user? How/why?
Cookies gets stored on a machine, so it can be used by more than one person but shouldn't be.
4. What would it mean to store a shopping cart in a cookie?
Less DB load, lose cross device availability
5. What advantages/disadvantages are there between cookie-stored carts and
database-stored carts?
cookie stored carts speed
db stored carts you can do across multiple devices, it's in the table its safe.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment