i have a big deal with user session monitoring. I need to kill session after closing last application tab or after browser closing.
So, this work was performed. I have developed small library for working with local storage and session storage and i developed mechanism for monitoring of opened browser tabs.
Just simple object with tab counter.
{
"session_instance_count" : 0
}
And simple methods for writing this object to localstorage:
SessionMonitor.prototype.writeValueByKeyToLS = function (key, value){
var own = this;
own.getLocalStorageInstance().setItem(key, value);
};
SessionMonitor.prototype.getLocalStorageInstance = function () {
return 'localStorage' in window && window['localStorage'];
};
But after deploying another application to Tomcat i have found serious troubles with local storage. All stored values from first application were available in second application.
I stored some data on http://localhost:8080/app1 this data will be available on http://localhost:8080/app2
App1 sending request to open App2 with some parameters
Note: I do not have access to modify source code of second application.
This is my question:
How to prevent passing HTML5 local storage data between two or more different applications which were deployed at the same container?