wtorek, 22 listopada 2011

HTML5 local storage in browser vs cookie

Local storage is cool - it behaves as cookie but allows you to keep more than cookie (cookie size limit is 4KB, and local storage allows you 5MB), and it is much more simple in use (there is no need to set expire date): To write to local storage:
localStorage.setItem("name_of_item", your_data)
To read from local storage:
your_data = localStorage.getItem("name_of_item")
If you want to keep some data only for current session, use:
sessionStorage
instead of
localStorage
Btw. everything you put into storage, will become string. If it doesn't want to fit - make it string.

Good tutorial about PHP objects, classes etc.

If you already know functions in PHP and want to make another step into world of classes, objects, etc.: http://www.killerphp.com/tutorials/object-oriented-php/php-objects-page-1.php