PDA

View Full Version : [FIXED-EXTJSIV-409] Ext.util.Cookies.clear doesn't remove a session cookie



dolittle
28 Mar 2011, 4:14 AM
Ext.util.Cookies.set uses path "/" by default.
Ext.util.Cookies.clear doesn't set a path so it doesn't remove a session cookie.

This override fixes this issue:

Ext.util.Cookies.clear = function(name) {
if(Ext.util.Cookies.get(name)){
document.cookie = name + "=" + "; expires=Thu, 01-Jan-70 00:00:01 GMT; path=/";
}
};

99% of the times people will use the path "/" for cookies anyway.

There are several reports about this issue but the team choose to ignore them:
http://www.sencha.com/forum/showthread.php?95309-DISCUSS-Ext.util.Cookies-gt-clear%28%29-should-include-path-info&highlight=cookie+clear
http://www.sencha.com/forum/showthread.php?98070-Ext.util.Cookies.clear%28%29-not-working&p=462560#post462560
http://www.sencha.com/forum/showthread.php?87334-CLOSED-3.-Ext.util.Cookies.clear-does-not-work
http://www.sencha.com/forum/showthread.php?86790-CLOSED-3.-Ext.util.Cookies.clear-is-Invalid
http://jupiter.mcom.fr/~clucas/blog/index.php?article608/extjs-how-to-real-clear-a-cookie