Why does not work code with jquery cookies?

Tell me why this code does not work?Even if the cookie is, the class is not removed
if (!$.cookie('cookie_name')) {
$('#msg').addClass('blackZone');
 $.cookie('cookie_name', 'cookie_value', {
 expires: 5,
 path: '/',
});
 } else {
$('#msg').removeClass('blackZone');
 }


Here is the entire code jsfiddle.net/1Lpdykhx/55
June 14th 19 at 20:10

Find more questions by tags HTTP CookiesjQuery