Rename cookie - Why element still showing even after clearing the cache?

0 votes
348 views
added Apr 16, 2020 in Javascript by LC Marshal Captain (25,790 points)
// You need to rename the cookie name, because the cookie will stay as long the previous cookie configure in place. For example 480 minutes.
// Initially, the cookie name 'catfish-cookie' - change it to 'catfish-new-cookie'

$goCatfish = $.cookie('catfish-new-cookie');
  if ($goCatfish == null) {
      $.cookie('catfish-new-cookie', 'test', { path: '/', expires: expCatfishTime });
      if(($(dfpCatfishFullId).css('display') == 'none')){ 
          $('.catfish-ads').hide();
           console.log('catfish display none');
      }
      else if ($('body').hasClass(excptBmpaPage)) {
        $('.catfish-ads').hide();  
      }
      else {
        $('.catfish-ads').show();
        $('.catfish-ads .slide-close').on('click', function(){
          $(this).parent().parent().removeClass('in');
        });

        if ($('body').hasClass('front')) {
          setTimeout(function(){
            $('.catfish-ads').addClass('in');
          },300);
          console.log('front');
        }
        else {
          // condition for not-front 
          setTimeout(function(){
            $('.catfish-ads').addClass('in');
          },300);
          // console.log('not-front');
        }
        // console.log('catfish display block');
      }
      // console.log('create catfish cookie');
  }

 

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...