Page MenuHomePhabricator

Cannot be logged in as user and sysop at the same time
Open, LowestPublic



usernames['wikipedia']['nl'] = 'valhallasw-botje'
sysopnames['wikipedia']['nl'] = 'valhallasw'
import pywikibot
s = pywikibot.Site()
s.login(False) # as user, asks for password
s.login(True) # as sysop, asks for password, *overwrites* cookies (!)
s.login(False) # as users, asks for password *again*

It should be possible to switch between sysop and bot accounts in a script without requiring the user to enter the password every time

Version: core-(2.0)
Severity: normal
See Also:


Related Gerrit Patches:
pywikibot/core : masterMulti-session cookie jar

Event Timeline

bzimport raised the priority of this task from to Needs Triage.Nov 22 2014, 3:19 AM
bzimport added a project: Pywikibot-General.
bzimport set Reference to bz65196.
bzimport added a subscriber: Unknown Object (????).
jayvdb set Security to None.
Mjbmr added a subscriber: Mjbmr.Feb 9 2015, 5:25 AM

Those are different usernames.

Those are different usernames.

Indeed. This task is exactly about storing the session cookies for different accounts at the same time.
See also T71283: dualism between user and sysop needs to be overtaken

Mjbmr added a comment.Feb 9 2015, 6:00 AM

There are different options to solve this:

  1. Caching password, which might still have problems with logging in different script which are sharing same cookie file, which each script have to log in again.
  2. We can use different cookie files for each user on each site, might people don't know about limiting permissions. also have to do a base64 encode on usernames in case file system might not accept a username as a file name.
  3. Writing cookies in different sections on the file, but still have conflict as I described in the number one.
  4. Can use SQlite as a cookie database.
gerritbot added a subscriber: gerritbot.

Change 189653 had a related patch set uploaded (by Mjbmr):
Separate cookie storage per user/project ( dataset using sqlite3)


Change 189653 had a related patch set uploaded (by John Vandenberg):
Separate cookie storage per user/project


Change 209873 had a related patch set uploaded (by John Vandenberg):
Multi-session cookie jar

Change 209873 abandoned by Multichill:
Multi-session cookie jar

No response. This can always be re-opened if you plan to work on it again.

Xqt moved this task from Backlog to Needs Review on the Pywikibot board.Feb 3 2019, 11:25 AM
Xqt triaged this task as Lowest priority.Feb 7 2019, 4:10 PM
Xqt assigned this task to jayvdb.Feb 7 2019, 4:22 PM