http://qs321.pair.com?node_id=11114882


in reply to Re: Grab username from WP Cookie
in thread Grab username from WP Cookie

This is on a private server with no risk of data loss. It's a very simple reservations system and I'm trying to use the Wordpress login instead of making people login again. I just need the username, not the password.

How would I look up the session without reading the cookie? Not sure how this would work.

Thanks.

Replies are listed 'Best First'.
Re^3: Grab username from WP Cookie
by jcb (Parson) on Apr 01, 2020 at 23:48 UTC

    You have to use the cookie as a search key to look up the session information wherever WordPress stores it. You need the cookie, but the cookie is an opaque token rather something you meaningfully read to extract information.

    Are you asking how to get the cookie in the first place? Is this system on the same domain, such that the user's browser will send the WordPress cookie?