Skip to content

Instantly share code, notes, and snippets.

@bayendor
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bayendor/bd055224d757e64c2663 to your computer and use it in GitHub Desktop.
Save bayendor/bd055224d757e64c2663 to your computer and use it in GitHub Desktop.
Storing State in Sessions
  1. What's the difference between a cookie and a session? A session lasts until the browser is closed, a cookie is persistent state stored in a small text file.
  2. What's serialization and how does it come into play with cookies? The cookies stores serialized data about the session.
  3. Can a cookie be shared by more than one user? How/why? Probably.
  4. What would it mean to store a shopping cart in a cookie? The shopping cart would persist from session to session.
  5. What advantages/disadvantages are there between cookie-stored carts and database-stored carts?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment