• i have a few scripts on my site that need to be password-protected. since i’m already running wordpress, i was trying to piggyback onto WP’s authentication. however, this is proving very troublesome.
    if i include wp-admin/auth.php into my scripts, as is suggested in some posts, then the page fails authentication, even if i have already logged in.
    basically, the calling script gets redirected by the
    if ( !veriflog() ) {
    ....
    }

    block, and then i’m shown the default admin page (post), since i actually AM logged on.
    any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Anonymous

    to answer my own question for those with the same problem:
    the problem is that if the script is outside of the wordpress dir, it will not read wordpress cookies.
    so to fix this, you need to to redefine COOKIEPATH in wp-includes/vars.php to include the dir that your script is located in. (in my case, just go one level up the dir tree)
    hope that helps other people

    To further help others, note that the COOKIEPATH define is no longer in wp-includes/vars.php; it’s now moved to wp-settings.php in the WordPress root.

    I found that

    define('COOKIEPATH', '/');

    did the trick!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘using wordpress authentication for other pages’ is closed to new replies.