This week's book giveaways are in the Jython/Python and Object-Oriented programming forums. We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line! See this thread and this one for details.
A third party cookie might help. For example when you are on aaa.com, load a cookie from bbb.com to store data. Many users often turn off third party cookie though so it may not very useful in an internet application. You can also use the hidden variable approach as said earlier.
Buffer holds the data temporarily before it is flushed to the ouputstream ( IN this case the browser) .. so when you have more than 1024 KB of data, some data is sent to the browser... This is perfectly normal behavior