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
}));
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn