Title: using wordpress authentication for other pages
Last modified: August 18, 2016

---

# using wordpress authentication for other pages

 *  Anonymous
 * [21 years, 9 months ago](https://wordpress.org/support/topic/using-wordpress-authentication-for-other-pages/)
 * 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
 * [21 years, 9 months ago](https://wordpress.org/support/topic/using-wordpress-authentication-for-other-pages/#post-77508)
 * 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
 *  [chrisdawson](https://wordpress.org/support/users/chrisdawson/)
 * (@chrisdawson)
 * [19 years, 6 months ago](https://wordpress.org/support/topic/using-wordpress-authentication-for-other-pages/#post-77854)
 * 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.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [chrisdawson](https://wordpress.org/support/users/chrisdawson/)
 * Last activity: [19 years, 6 months ago](https://wordpress.org/support/topic/using-wordpress-authentication-for-other-pages/#post-77854)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
