Forums

Checking if user is logged in externally (6 posts)

  1. wraithstk
    Member
    Posted 2 years ago #

    I need to be able to check if a user is logged in without including any files. Is there a way to do this with cookies or something else?

  2. roy-duff
    Member
    Posted 2 years ago #

    <?php
    
    if ( !is_user_logged_in() ) {
    
    //not logged in
    
    } else {
    
    //is logged in
    
    }
    ?>
  3. wraithstk
    Member
    Posted 2 years ago #

    But this is an external page so is_user_logged_in() is not yet a function

    [moderated--bump removed. Please refrain from bumping as per Forum Rules]

  4. MichaelH
    Volunteer
    Posted 2 years ago #

    Would normally point you to Integrating_WordPress_with_Your_Website, but since your requirement is "without including any files" then look at WordPress Cookies.

    Related:
    http://wordpress.org/extend/plugins/tags/authentication

  5. wraithstk
    Member
    Posted 2 years ago #

    How do I use these cookies to check if they are logged in?

  6. MichaelH
    Volunteer
    Posted 2 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic