here’s a thread that might answer your question. you probably also need to put
require_once('./blog/wp-blog-header.php');
in whatever page in your site root that’s trying to access the login info.
btw, a related problem arises when people try to display their blog at the root url but host the wp files in a subdirectory of the root. here’s an explanation of the problem, and the technique (basically what you just described above) for dealing with it.
Thanks everyone! This is a nice hack, but the functionality it enables (login detection) is actually ESSENTIAL to anyone who’s got WP installed in a different directory than the blog url.
Which makes you wonder: Why isn’t this trick (or the equivalent) described IN THE OFFICIAL DOCUMENTATION (SEE ABOVE)?
It’s nice of the ww.wp.xz.cn team to tell us about giving WordPress its own folder, but without the cookie hack here, people are going to be VERY FRUSTRATED they can’t get edit_post_link() and wp_loginout() to work!
Please merge this hack into the codex!