If you are in extjs application designing and coding, you might need to use use ‘Ext.util.Cookies.*’ function.
You can :
- Ext.util.Cookies.get(‘my_cookie’) : get cookie value
- Ext.util.Cookies.get(‘my_cookie’, ‘cookie_value’) : set cookie value
- Ext.util.Cookies.clear(‘my_cookie’) : clear cookie
In theory you can delete cookie by means of ‘clear’ function.
In practice, you should use :
Ext.util.Cookies.set('my_cookie', null, new Date("January 1, 1970")); Ext.util.Cookies.clear('my_cookie');
Because you can be faced to a problem where you cannot delete your cookie and cannot understand why…