Have you checked that the cookie is actually being written?
In any case your cookie reader should return a string not type object, which is what your notes suggest you're getting.
You could try the function below instead.
Remember that the value returned is still a string until converted using JSON.parse();
function getCookie( naam )
var cookieArray = document.cookie.split( /;\\s*/ ),
cValue = "";
for( var teller = 0; teller < cookieArray.length && !cValue; teller++ )
if( ( cookie = cookieArray[ teller ] ).indexOf( naam ) == 0 )
cValue = cookie.split( "=" )[ 1 ];
return decodeURIComponent( cValue );