How to read cookie from different path in the same domain

I have three paths as follows within the same domain.

http://mysite.company.com/path1
http://mysite.company.com/path2
http://mysite.company.com/path3

When I am on site “http://mysite.company.com/path1”, how do I read the cookie on “http://mysite.company.com/path2” and “http://mysite.company.com/path3” 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=/.