This answers the last part of the question. Auto close the session with closing the browser. According to Wikipedia: When an expiry date or validity interval is not set at cookie creation time, a session cookie is created. Web browsers normally delete session cookies when the user closes the browser.
The task at hand is to create a cookie without an expiry date using Ext-state-CookieProvider
. Leaving out the expires
configuration at all, will cause ExtJS to default it to 7 days. Check the source for this. Therefore you need to create the cookie with an explicit expires
of null, like so:
var cp = Ext.create('Ext.state.CookieProvider', {
expires: null
});
All cookie values will be deleted when the browser closes.