From this link I saw that For every instance of a RAP UI, a separate UISession is created. That means that when a user accesses an entry point, that’s a new UISession. When the user reloads the page in the browser, that’s also a new UISession.
And in my application when the browser is refreshed (usually by hitting F5 or close browser and open again) and from MAT (Memory Analyzer Tool) report I see that something call UISessionImpl is created as much as the time browser refreshed. That means new UISession is created but the old sessions is still there.
So my question is "How can I clear session every time the browser refresh?".
EDIT
My code:
RWT.getUISession(myDisplay).exec(new Runnable() {
@Override
public void run() {
RWT.getRequest().getSession().setMaxInactiveInterval(1);
}
});