I'm creating a plugin that will submit requests via AJAX. As there will potentially be a lot of people submitting requests at once I call the file directly rather than through the WP ajax (reference).
I do however need to check if the user is logged in and if possible see if they're an admin and I've tried using this but it returns false for
is_user_logged_in() and 0 for
I've checked the headers of my AJAX call and the session cookies are being sent, it's over https and I'm of course logged in.
Could someone point me in the direction to be able to find out if the user is logged in / an admin?