[wp-trac] [WordPress Trac] #21043: is_user_logged_in() returns true even if user is not logged in

WordPress Trac wp-trac at lists.automattic.com
Thu Jun 21 20:40:14 UTC 2012


#21043: is_user_logged_in() returns true even if user is not logged in
-------------------------+-----------------------------
 Reporter:  TomAuger     |      Owner:
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Users        |    Version:  3.4
 Severity:  normal       |   Keywords:  dev-feedback
-------------------------+-----------------------------
 If you have {{{wp_set_current_user()}}}, then {{{is_user_logged_in()}}}
 will always return true. This goes against my understanding of the role of
 wp_set_current_user() especially as explained by the documentation:

 "Some WordPress functionality is based on the current user and not based
 on the signed in user. Therefore, it opens the ability to edit and perform
 actions on users who aren't signed in."

 But then we look at {{{is_user_logged_in()}}} and it just says - can we
 {{{get_current_user()}}}?

 Suddenly wp_set_current_user is looking like wp_switch_logged_in_user(),
 which I doubt is the intent of that function.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21043>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list