Cookies are small fractions of space that sites use to store user-specific info in user browsers. So that servers would know that a returning user is not a new one. That's how you remain logged in after you leave a website and come back later. Cookies is the link between your previous and next sessions.
Web storage is cookies evolved. Cookies have lots of tecnical issues we're not gonna discuss now, but Web storage aims to fix them.
Why would it matter in SEO?
As you may know, developers tend to choose the shortest way to implement the functionality ordered by business. Even though employers now tend to look for developers who know about SEO, it doesn't help. They still wouldn't consider SEO during the development.
Cookie-based redirection. A french user hits the site, the site determines the IP geolocation and redirects the user to the /fr/ version, setting something like "loc=fr" in cookies. Now if this user tries to hit any non /fr/ page, they will be redirected to the proper /fr/ page unless they change the language manually, in which case their cookie will be overwritten with the new value. And the redirections continue.
I know, I know. Conducting such an experiment on only one page is not enough and I partially agree. Yes, it is interesting how Google carries cookies from one page to another. It's just I watch G webmastertools hangouts
And they discussed it recently, revealing the fact that G carries cookies through one crawling session, but not between the sessions, which is exactly what you would expect from G.
Okay, now that we left the cookie-based output in that h3, we can experiment with the web storage a little.
Does Google use Web Storage?
The approach will be similar: we'll have a tiny bit of JS that sets it on the fly and then checks if it's set. Below:
Okay, I must say working with web storage is a lot more pleasant than parsing through cookies. I want to express my gratitude to those who came up with the technology and implemented it.
Looks like we're done. We set the cookies and webstorage. Now let's check if Google sees the related text.
Okay, I couldn't wait so I fetched and rendered. Looks like Google does see both.
We'll wait till it's indexed though.
Ok, now it's indexed and ranking. As expected.
Googlebot uses both cookies and web-storage.