I have below code for `Reading` and `Setting Cookie` taken from `w3schhols.com`. I have problem while incrementing the value of Cookie

```
function isNumber (o) {
    return ! isNaN (o-0) && o !== null && o.replace(/^\s\s*/, '') !== "" && o !== false;
}
function setCookie(c_name,value,exdays)
{
    var date=new Date();
    date.setTime( date.getTime() + (exdays*24*60*60*1000) );
    expires='; expires=' + date.toGMTString();
    document.cookie=c_name + "=" + value + expires + '; path=/';
}
function getCookie(c_name)
{
    var c_value = document.cookie;
    var c_start = c_value.indexOf(" " + c_name + "=");
    if (c_start == -1) {
        c_start = c_value.indexOf(c_name + "=");
    }
    if (c_start == -1) {
        c_value = null;
    } else {
        c_start = c_value.indexOf("=", c_start) + 1;
        var c_end = c_value.indexOf(";", c_start);
        if (c_end == -1) {
            c_end = c_value.length;
        }
        c_value = unescape(c_value.substring(c_start,c_end));
    }
    return c_value;
}

```

And I am using below function to increment :-

```
function addToCart() {
var totalcart = getCookie("totalcart");
if (totalcart != null && totalcart != "" && isNumber(totalcart)) {
    totalcart += 1;
    setCookie('totalcart',totalcart, 2);
    jQuery('#totalcart').text(totalcart);
} else {
    setCookie('totalcart', 1 , 2);
    jQuery('#totalcart').text('1');
}
}

```

But instead of Incrementing Value from `1` to `2`. It is actually putting value beside it :-
`11` -> `111` -> `1111` and so on and so forth.

How could i increment cookie value.

Thanks