Manual:invalidateUserSessions.php

From Linux Web Expert

The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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 <translate> Optional</translate>
--file File with one username per line <translate> Optional</translate>

Although both options are optional, either --user or --file is required to run the script.

Usage

php maintenance/invalidateUserSessions.php [ --user | --file ]

Invalidating session for user Jay

Terminal
Tip 1: Spaces inside a username must be replaced with underscores ( _ ) or use double quotation like "Foo Bar"

Invalidating list of users' session

userlist.txt
Foo
Bar
Jay
Aman
Kamal Kumar
FlyingWings123
LogicFreek
AK Saini
AyraIn326
MileFireFee
Terminal

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.

See also