I think I do not understand the requirement here.
This sentence:
"I am trying to force logout when I log in in my plugin"
reads to me like you want to log the user out when someone starts trying to use your plugin. This sounds broken to me, because once logged out, they would not be able to use your plugin, as they've logged out of the system the plugin was doing things in.
Could you explain this more to us please?
I mean, I want to log out the logged in user if it is not an admin user.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That would be a bad thing to do to a person trying to use your system, and I cannot work out how that would be useful to anyone. If someone is not an admin and they land on an admin link, why would you not just tell them "you are not an admin, so yo can't do this" and leave them logged in to continue what they were doing, rather than log them out and stuff up their experience?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is a horrid thing to do to your people. Why not just give them a "you do not have access to this page, but we're not going to throw you out for clicking on something" message?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.