![]() |
Anyway to force a logout of all users?
I am having problems with a current mod and the only way to cure it at this point is to FORCE a user to logout and then have them relog back in. Rather than explain this to EVERY user there has gotta be an easier way of FORCING all users to logout or clear their cookies for the forum so that if they had the "REMEMBER ME" box checked they would still be required to login. Is there an SQL query or a template edit that I can run or change to make this happen?
OR even better if there is a way to change the actual TIME a user can stay logged in via the REMEMBER ME box. Like make it so that they can only stay logged in for 24 hours or however long I specify. |
<a href="https://vborg.vbsupport.ru/showthread.php?t=163327" target="_blank">https://vborg.vbsupport.ru/showthread.php?t=163327</a>
|
Quote:
|
Empty (truncate) the session table maybe?
|
Quote:
|
Ah yes, you are right.
Change the cookie path or domain to something invalid? Of course, this is assuming you can then change it back via the database so you can get back in (or reset it with tools.php). I'm sure there must be a better way though. |
Quote:
|
Restarting mysql and apache seem to do the trick pretty good for me :D
|
Clear the cookies. You just set empty values to the "userid" and "password" cookies. However, I'm not sure how you would control this to only once without some messy workarounds (another cookie maybe?).
|
Quote:
Quote:
|
Quote:
This method would have to stay active until each logged in user has viewed the forums, and until then without additional coding no users could log in. If you know about cookies you might be able to reset vbulletin's cookie and then use one to save the info when they try and log-in again. |
Hmm is there possibly a piece of code that I could add to my index.php file so that when the user browses to that page the system will reset their cookies causing them to logout? Then along with that piece of code I could specify how long the user is allowed to stay logged in until they get logged out and have to log in agian... For example something like ...
PHP Code:
|
i restart my vps server, that clears everyone out
|
Quote:
If you have access to your whole sever, you could reset its stored sessions, which should log out all users. |
Quote:
|
I may have spoken too quickly on that last comment. I was under the impression that you could clear sessions since they are (at least partly) sever sided, however I'm not sure exactly where they are saved or how to clear them.
Better suggestion - use a php script that writes a session such as $_SESSION['flush'] = 1; to mark the user has already seen the script, if they haven't viewed the script yet redirect them to the logout page. Code:
<? |
PHP Code:
|
Quote:
Quote:
|
If you only need to firce logout once (or not often) then clearing the session table and changing the cookie prefix in your config.php should do the trick.
|
Quote:
|
Quote:
|
Actually only changing the cookie prefix might already be enough but it is easy to clear the session table.
|
All times are GMT. The time now is 05:23 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|