get_currentuserinfo() pulls the wrong user info.
-
I’ve got a WP site with about 8,000 subscribers and 3 admins.
Within, I have a page template that is wrapped in a if_user_logged_in() function so it feeds up content for any logged in subscriber can view, or otherwise redirect to login.
Also in that page template is a “Welcome, {username}” readout: Here’s the code I’m using to grab that username. It’s in an include header at the top of the page template.
global $fullname; get_currentuserinfo(); $fullname = $current_user->user_firstname . " " . $current_user->user_lastname;
Problem is, the user name will appear correctly upon first login. If I log in as a different user on another computer, the original login will start feeding up the newly logged in user.
Any ideas?
Some questions from my research:
Can the user cookie be updated from another section?
Are user sessions based on IP? And are they updated if someone in the same IP logs in?
Is the user function just faulty?Any feedback would help.
- The topic ‘get_currentuserinfo() pulls the wrong user info.’ is closed to new replies.