Ext.state.CookieProvider = function(config){
Ext .state.CookieProvider.superclass.constructor.call(this);
this.path = "/";
this.expires = new Date(new Date().getTime() (1000*60*60* 24*7)); //7 days
this.domain = null;
this.secure = false;
Ext.apply(this, config);
this.state = this.readCookies ();
};
Ext.state.CookieProvider = function(config){
Ext.state.CookieProvider.superclass.constructor.call(this);
this.path = "/" ;
this.expires = new Date(new Date().getTime() (1000*60*60*24*7)); //7 days
this.domain = null;
this. secure = false;
Ext.apply(this, config);
this.state = this.readCookies();
};
We can set expires value to change the default storage time, for example:
this. expires: new Date(new Date().getTime() (1000*60*60*24*365)), //One year
this.expires: new Date(new Date().getTime() (1000 *60*60*24*365)), //One year
Or we can add the following code to the Ext.onReady function at the beginning
Ext.state.Manager.setProvider(
new Ext.state.CookieProvider({
expires: new Date(new Date().getTime() (1000*60*60*24*365)), //One year
}));