Having a strange issue where I am checking for the current user by using the wp_get_current_user command and occasionally, users have reported to seeing the information for another user. Should I be checking for the current user a different way? This is scary because the information that I am displaying for the users is sensitive and I need the system to only show the current user and not another user that is also logged in.

So, the code snippet is a widget I created for my plugin that shows a user's dashboard. What is supposed to happen is that once a user logs in, the widget gets the current user's ID, then looks up their account in my table (wp_ssm_user) and returns the row that matches the wp_user->ID and is displayed on the dashboard. Problem is, some users are reporting that when they log in and perform certain functions (I'm awaiting a reply as to which function in particular), they are redirected to the dashboard where a different user's information is displayed.

There is no redirect at all in that code so I am leaning toward thinking the real issue is elsewhere. I'll wait for the additional information before speculating more. How is that function called/hooked?
–
s_ha_dum♦Jun 29 '13 at 17:41

It's a shortcode. I add the shortcode to a page. And you are correct as far as the redirect. The redirect happens from another shortcode. Not sure it is a valid point, but I did find this question which @Jesse answered with the point of using global $current_user when trying to get the current user information. I was using the wp_get_current_user() method. Not sure if it makes a difference but I am testing it currently.
–
ClockwiseQJun 29 '13 at 18:31