WordPress.org

Ready to get started?Download WordPress

Forums

$_COOKIE empty within included wordpress page (1 post)

  1. fv
    Member
    Posted 7 years ago #

    hello,

    i've (for me) strange phenomena regarding cookies not beaing readable within a wordpress page getting included from a non-wordpress app running on the same server.

    aim:
    what i wanna do is listing wordpress categories within the sidebar of another application running on the same server. to do so i created a wordpress page, assigned a custom template to it, which reads the wordpress categories and prints them out in html. then i include this page from another application running on the same server. that works fine.

    problem:
    but now i installed the ac_authenticator.php plugin to have the wordpress blog accessible for registered users only. and after doing so the included wordpress page doesn't seem to recognize the set cookies and so i get redirected to the wordpress login page.
    $_COOKIE is just an empty array for the ac_authenticator.php plugin when it gets called from the included wordpress page.
    (i also installed the root-wp-cookie cookie to have cookies valid for the whole server and not only for the /blog/ directory.)

    does anybody have any idea, why the $_COOKIE array is empty within ac_authenticator.php getting called from the included wordpress page?

    code:
    from the externall app i include a wordpress page:
    include('../blog/?page_id=7');

    as far as i don't use ac_authenticator.php that works just fine, but with the plugin activated, this include redirects me to the wp-login page as ac_authenticator.php receives $_COOKIE being empty.

    if i add a print_r just a line after (or before) having included the wordpress page, the $_COOKIE works fine and is filled with the wordpress_user etc. cookies.
    include('../blog/?page_id=7');
    print_r($_COOKIE);

    so why for the included wordpress page resp. ac_authenticator $_COOKIE is empty?!

    bests,
    fabian

Topic Closed

This topic has been closed to new replies.

About this Topic