Manual:InvalidateUserSessions.php

invalidateUserSessions.php maintenance script invalidates the sessions of certain users on the wiki. After the session invalidate, the users will be logged out from the browser/app.

If you want to invalidate all sessions, use $wgAuthenticationTokenVersion instead.

Options
invalidateUserSessions.php accepts following two options.

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

Usage

 * Invalidating session for user Jay

Filename: userlist.txt Foo Bar Jay Aman Kamal Kumar FlyingWings123 LogicFreek AK Saini AyraIn326 MileFireFee
 * Invalidating list of users' session

Common error
It comes when you try to use both options at once. You always have to use either --user or --file at once.
 * 1. Cannot use both --user and --file

It comes when the file does not exist or the user running the script does not have permission to read the file.
 * 2. Could not open $filename

In case file does exist, check file permission. If you are root user then you can run script with sudo.