How to read cookie from different path in the same domain

I have three paths as follows within the same domain.

When I am on site “”, how do I read the cookie on “” and “” paths ?

Here is my function to read the cookie but this takes only one parameter cookie name.
function readCookie(name) { var nameEQ = name + “=”; var ca = document.cookie.split(‘;’); for(var i=0;i < ca.length;i++) { var c = ca[i]; while (c.charAt(0)==’ ') c = c.substring(1,c.length); if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);}
return null;}

Thanks for the help.

You can only specify a path when setting a cookie. It determines the highest level at which the cookie can be accessed. If you control all the code on the site, set all cookies with path=/.