Deleting multiple cookies
Have a section of code that is hiding or showing content in a filter setting. If a user moves back a week it will cookie the settings of the filter. The only bad thing is when a user un-selects a filter the cookie doesnt ignore that and puts it up on the next page even though you unselect that filter. Any help on how I take away the cookie filter if they un-select it?
if ( filter.id == 'show-all' || $('#filters .selected').length < 1 )
{
var d = new Date();
$( '#filters .selected' ).removeClass('selected');
$( '#show-all' ).addClass('selected');
$( '.new-hire' ).show();
$( '.termination' ).show();
$( '.update' ).show();
} else {
$( '#show-all' ).removeClass('selected');
hideAll()
$( '#filters .selected' ).each(
function()
{
$('.' + $(this).attr('id')).show();
document.cookie = $(this).attr('id') + '-filter = true; path=/'
}
)
}
} // filter
function setCookie( filter )
{
document.cookie = 'bridge-filter = ' + filter + '; path=/'
} // setCookie