Hacker News new | ask | show | jobs
by dudus 5266 days ago
The idea is not to get rid of the data that is stored in the cookie. But instead to move it into the localStorage. Still acessible through JS and doesn't ge into the HTTP request.
1 comments

But the data still needs to go the Google Analytics server to actually do the tracking...in an HTTP request.
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.