[wp-hackers] Using WP Transients for User Sessions

J.D. Grimes jdg at codesymphony.co
Wed Oct 16 14:11:38 UTC 2013


First, this is not your transient:

> _transient_timeout_feed_mod_ac0b00fe65abe10e0c5b58…
> 1380374961

Yours would look have 'users_online' in it. The easiest way to check if it was deleted is to call get_transient(). If it returns false, then the delete must have worked (or it is expired).

Secondly, there is a problem with your logic here, I think. You are deleting the data for all logged in users, when a single user logs out. I don't think that is what you want to do. You will want to either use a different transient for each user, or just delete them from the array when they log out.

--J.D.


More information about the wp-hackers mailing list