Skip to content

Instantly share code, notes, and snippets.

@AndyDangerous
Last active August 29, 2015 14:05
Show Gist options
  • Save AndyDangerous/2a885b24452c4a6a31d0 to your computer and use it in GitHub Desktop.
Save AndyDangerous/2a885b24452c4a6a31d0 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 cookie is a file stored on a user's computer that stores some information (including session information) - a session is something accessible in your app which can store information (albiet a ver small amount of it) - it's a hash
  1. What's serialization and how does it come into play with cookies?
  • Serialization is the encryption that turns your session into a (JSON, for rails) cookie that is sent back with the HTTP response. State in a STATELESS land.
  1. Can a cookie be shared by more than one user? How/why?
  • Nope. The cookie is some encrypted shit that is specific to one computer-server connection
  • I guess, maybe, if the users are on the same computer? That's a dumb idea.
  1. What would it mean to store a shopping cart in a cookie?
  • It would mean that you are storing a bunch of data in/as a hash and then "inflating" it as necessary into your objects
  1. What advantages/disadvantages are there between cookie-stored carts and database-stored carts?
  • Check mah blahg (once I get a minute to build it.
  • This is an interesteing question. Let's explore it in three paragraphs:

Webtwo ipsum dolor sit amet, eskobo chumby doostang bebo. Sclipo zlio hipmunk palantir revver chegg wesabe, fleck ifttt bitly loopt akismet yammer edmodo, wakoopa airbnb ning rovio napster klout. Disqus kiko zoho oooj klout meebo napster zillow shopify heekya kiko ideeli, doostang jabber chumby hulu waze dropio reddit handango bebo movity, ifttt voki flickr spock lala foodzie revver zimbra wufoo spotify. Nuvvo joyent nuvvo plugg glogster jabber trulia cuil plaxo sclipo, koofers jajah unigo chumby sococo movity unigo. Joukuu boxbe jajah zappos trulia ifttt wakoopa, zoodles meebo waze voki imvu ning, sifteo lijit trulia kippt eskobo.

Kippt squidoo waze ifttt kno prezi heekya ngmoco klout disqus orkut, gsnap knewton squidoo orkut zoodles spock diigo shopify odeo yoono, dopplr groupon zoodles ifttt lala quora groupon vimeo oovoo. Grockit koofers blekko zillow kiko loopt squidoo oovoo, chegg blippy bebo stypi eduvant hojoki, chartly wufoo ngmoco orkut cuil twitter. Scribd hipmunk mog kosmix xobni hojoki plugg yammer shopify, hipmunk spock boxbe revver woopra divvyshot jabber omgpop kaboodle, handango blekko kippt jumo yuntaa ngmoco udemy. Dogster ebay hulu ideeli klout, omgpop kaboodle handango mog zoho, vimeo eskobo kazaa.

Jiglu zimbra kiko etsy bubbli edmodo appjet buttera dropio, yoono heroku dogster plaxo plugg spock akismet, weebly chumby meebo geni bebo bubbli lala. Voki gsnap twones wesabe groupon orkut ifttt meebo ebay udemy, chegg twones imvu chumby divvyshot heroku zynga blyve, orkut jibjab fleck mobly koofers joukuu sococo mzinga. Rovio akismet jiglu ifttt reddit plaxo diigo heroku akismet dogster ifttt chegg, zoosk disqus woopra zimbra chumby orkut rovio tivo palantir greplin, skype sclipo wesabe dropio glogster tumblr joyent unigo chartly oooj. Yammer ifttt imvu ifttt zappos, buttera jabber.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment