Messages in web application

It comes from here

There are ways to communicate between pages and domains:

using window object

Defects:
		You need to open a window from your current window and 
		then you can communicate only as long as you keep the windows open. 
		If you reload the page in any of the windows, you most likely lost the communication.

using window.postMessage

Can on web worker thread sample

Can cross origin
 	the defects are the same of first one

using dispathEvent

using cookies

You have to implement some sort of timeout to read the cookie periodically. 
Furthermore you are limited by maximum cookie length, which is 4KB.

using localStorage

sample
 pollute local storage, 

using BroadcastChannel

 Old browser didn't support this
sample