Copy Code code as follows:
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 change the default storage time by setting the expires value, for example:
Copy Code code as follows:
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 in the start position
Copy Code code as follows:
Ext.state.Manager.setProvider (
New Ext.state.CookieProvider ({
Expires:new Date (new Date (). GetTime () + (1000*60*60*24*365)),//One year
}));