My requirement is to login the user into WP from an external PHP script and publish a post.
Once logged in, I would like the user to navigate to a regular wordpress page and not require to log in (manually) again.
Everything including the posting is working fine,
when I open a new browser tab or navigate to a wordpress page from my PHP script the user is found not logged in.
I am using the following function to log in the user. What am I missing?
One little update. I checked the cookies and I am seeing 3 cookies set for the user. Including the logged_in cookie, which expires 14 days from now. But still for some reason I am not getting logged in from another/same browser window.
It was a red-herring, please ignore it. The issue was that cookie URL set had a www while the page where I was trying to access it had the domain name without www, hence the browser was not sending the right headers in GET. My bad.
I have developed several custom php pages & a css page on my local computer NOT using wordpress, these query a mysql db and subsequently display results. Now I need to integrate them into an existent site created by WordPress, where do I upload these files to and how do I link them to a wordpress php page, where do they live?.
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Logging in from external PHP script and staying logged in’ is closed to new replies.