Update
——
I found out what is causing the problem. My site is having buddypress installed and I am using a theme called Edu-Clean. A part of code in global.js in edu-clean theme is causing this problem. Here is the code which is causing the problem
/* Clear BP cookies on logout */
j('a.logout').click( function() {
j.cookie('bp-activity-scope', null, {path: '/'});
j.cookie('bp-activity-filter', null, {path: '/'});
j.cookie('bp-activity-oldestpage', null, {path: '/'});
var objects = [ 'members', 'groups', 'blogs', 'forums' ];
j(objects).each( function(i) {
j.cookie('bp-' + objects[i] + '-scope', null, {path: '/'} );
j.cookie('bp-' + objects[i] + '-filter', null, {path: '/'} );
j.cookie('bp-' + objects[i] + '-extras', null, {path: '/'} );
});
});
});