Hacker News new | ask | show | jobs
by TylerE 5266 days ago
But the data still needs to go the Google Analytics server to actually do the tracking...in an HTTP request.
1 comments

Yes, but you wouldn't have to send the cookie to Google's servers every page load. This is a great use of the localStorage or sessionStorage in HTML5. Another obvious benefit we will see when using sessionStorage in specific is that you can store your session ID in that storage space and not have to worry about logging in from a new tab causing a session to overflow from one tab to the other.

Cookies are shared between browser sessions, but sessionStorage is not. localStorage is the same way except it persists over browser sessions and between tabs.