I have wordpress installed and when a user logs in, it saves a cookie in the temporary files with the name of wordpress.
I want to retrieve the value of the cookie using php in another page (out of wordpress). What would be a method to retrieve a persistent cookie in php.
I notice three key value pairs on my local worpress installation. If you can place the php file under the same domain, then you can obtain the cookies as it appears worpress appropriately sets the cookie to “/”. So for instance the key “wp-settings-1”.
cookie_test.php
It has to be under the same domain. Locally I just drop this anywhere in the worpress folder and it will work when you browse to it.
Look in
$_COOKIE
.However, keep in mind, that the path may be set different to where you want to read it.
You keep saying that its under localhost. But the point is, the cookie data wont be available between subdirectories of localhost. like the cookie set at
http://localhost/wordpress
wont be available athttp://localhost/drupal
.. you can only access the cookies ofhttp://localhost/wordpress
in that directory or subdirectories of it e.g.http://localhost/wordpress/test-page
..