Hello Support and Everyone.
I really happy with this forum. So useful.
By the way, i have a problem with session and cookies (maybe). First, i logged in with my admin account in firefox browser. I have finished my setting on admin beck end, then i need to test as a visitor with other browser. In this case i use chrome.
But, i think something wrong. When i refresh my website using chrome, there automatically logged in into admin account. I think this is error about session, may be with cookie also.
I try to search anything in internet with my issue, and i found this script tutorial.
// Allow only one logged in session for users
function wp_destroy_all_other_sessions() {
$token = wp_get_session_token();
if ( $token ) {
$manager = WP_Session_Tokens::get_instance( get_current_user_id() );
$manager->destroy_others( $token );
}
}
add_action(‘init’, ‘wp_destroy_all_other_sessions’);
I need help to solve this issue. Because i think it’s too danger. Can anyone help me?
Thanks.
-
This topic was modified 8 years by
nurrohmat.
Hi Christ, thanks for your feedback. I think i have to explain more details. First, i have to make this clear that my site enabling membership. Anyone can register.
For example, someone i called “Mr. A” register as a subscriber on my site. And then the other one (Mr. B) register as a subscriber also.
But, when Mr. A read my post, jump post to post, suddenly on his browser he logged in as Mr. B. The photos, comment, everything change to Mr. B.
That’s my issue actually. And sometime, Mr. A suddenly logged in as Mr. Admin. 🙁 So, he can change everything on my site that i don’t want.
Can you suggest me what i have to do?
Thanks.
Likely a flaw in the membership plugin you’re using that is setting IP based cookies, vs session cookies. So, anybody coming in on a shared IP gets access. That is only a guess, of course.
Theme has nothing to do with the membership plugin, obviously.
Likely want to check the support forum and page for the plugin you’re using, to see what others have reported as issues/flaws, etc.
( I don’t work here. )
Thank you Chris for your friendliness. I post it here just want to discuss with WordPress expert and PHP expert like you. 🙂
Anyway thanks for all. After this, i’ll try to discuss with my plugin support.
Cheers…
NB: Many thanks your for your post about security and other, really help me. And i happy you always help other people in this forum. 🙂
