Manual:InvalidateUserSessions.php
MediaWiki file: invalidateUserSessions.php | |
---|---|
Location: | maintenance/ |
Source code: | master • 1.43.1 • 1.42.6 • 1.39.12 |
Classes: | InvalidateUserSesssions |
Details
invalidateUserSessions.php maintenance script invalidates the sessions of certain users on the wiki. After the session is invalidated, the users will be logged out from the browser/app.
If you want to invalidate all sessions, use $wgAuthenticationTokenVersion instead.
Options
Option | Required | Default value | |
---|---|---|---|
--user | A username | Optional | |
--file | File with one username per line | Optional |
Although both options are optional, either --user or --file is required to run the script.
Usage
php maintenance/run.php invalidateUserSessions [ --user | --file ]
php maintenance/scriptName.php
instead of php maintenance/run.php scriptName
.Invalidating session for user Jay
$ php maintenance/run.php invalidateUserSessions --user "Jay" Invalidated sessions for user Jay
Invalidating list of users' session
Foo
Bar
Jay
Aman
Kamal Kumar
FlyingWings123
LogicFreek
AK Saini
AyraIn326
MileFireFee
$ php maintenance/run.php invalidateUserSessions --file userlist.txt Invalidated sessions for user Foo Invalidated sessions for user Bar Invalidated sessions for user Jay Invalidated sessions for user Aman Invalidated sessions for Kamal Kumar Could not find user FlyingWings123, tried to invalidate anyway Invalidated sessions for user LogicFreek Could not find user AK Saini, tried to invalidate anyway Invalidated sessions for user AyraIn326 Invalidated sessions for user MileFireFee
Common errors
- Cannot use both --user and --file
This error occurs when you try to use both options at once. You always have to use either --user or --file.
- Could not open $filename
This error occurs when the file does not exist or the user running the script does not have permission to read the file.
If the file does exist, check the file permissions. If you are root user, then you can run script with sudo.