Localstorage > Cookies

1,089 views

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,089
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Localstorage > Cookies

    1. 1. localStorage > cookies Making the Switch in Modern BrowsersPresented byShane Riley@shaneriley • github.com/shaneriley • shaneriley.com
    2. 2. In the Beginning...
    3. 3. And it was good enough
    4. 4. DifferencesCookies localStorage
    5. 5. DifferencesCookies localStorage• All in one string
    6. 6. DifferencesCookies localStorage• All in one string• Expire
    7. 7. DifferencesCookies localStorage• All in one string• Expire• Cross-subdomain
    8. 8. DifferencesCookies localStorage• All in one string • Properties on Object• Expire• Cross-subdomain
    9. 9. DifferencesCookies localStorage• All in one string • Properties on Object• Expire • No expiration• Cross-subdomain
    10. 10. DifferencesCookies localStorage• All in one string • Properties on Object• Expire • No expiration• Cross-subdomain • Local to subdomain
    11. 11. Storage LimitsCookies localStorageGuaranteed minimum of 300 localStorage 2.5mb limit percookies, 4kb per, 20 per host/ domain (Webkit stores asdomain. Overhead costs per UTF-16), unlimited propertiescookie (~50char). per domain, spec recommends using same storage across subdomains, no expirylocalStorage support: http://dev-test.nemikor.com/web-storage/support-test/
    12. 12. Methods!
    13. 13. getItem/setItem
    14. 14. removeItem clear
    15. 15. keyNot at all useful. Use an object iterator instead.
    16. 16. localStorage > cookies!
    17. 17. But not great (,_,)
    18. 18. localStorage stores ALL entries as strings
    19. 19. But wait! There is hope!
    20. 20. But wait! There is hope!
    21. 21. Make your own storage methodshttps://gist.github.com/3798945
    22. 22. Detect support
    23. 23. Thanks!Presented byShane Riley@shaneriley • github.com/shaneriley • shaneriley.com

    ×