0
votes

I'm about to start working on a bespoke website that will run alongside a clients Wordpress site. I need it so that when the user logs in to Wordpress they can access the logged in section of the bespoke website without having to enter new details.

I haven't been able to find out exactly how Wordpress manages logged in users. From research it doesn't look like it uses PHP Sessions. I have found reference to an is_user_logged_in() function.

Does this mean Wordpress stores something in the database to say a user is logged in, then delete the value after a certain amount of time, or is something else being done?

1
WordPress is not storing server-side sessions for logged in users, but uses client-side cookies instead. See: wordpress.org/support/article/cookies - Tom

1 Answers

0
votes

WordPress stores hashed cookies. Read more here:

https://wordpress.org/support/article/cookies/#users-cookie

On remote websites you can use WordPress as a headless CMS and check if a user is logged in (or log in a user) with the help of the WordPress REST API.