Last modified: 2009-12-09 15:04:47 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 9981 - Bot keeps losing session cookie
Bot keeps losing session cookie
Product: Wikimedia
Classification: Unclassified
General/Unknown (Other open bugs)
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
Depends on:
  Show dependency treegraph
Reported: 2007-05-20 17:08 UTC by Sebastian Moleski
Modified: 2009-12-09 15:04 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Description Sebastian Moleski 2007-05-20 17:08:15 UTC
For about a week now my bots keep losing session information. Until now, the bot would open special:userlogin at the start of a run, keep the cookie it gets and send it with each edit. For some reason, this doesn't seem to always work anymore. A good example of what happens can be shown here:
1.) logged on:
2.) suddenly logged off:

There are no IP changes and a delay of no more than 20 seconds between the edit with and without login information. Is there something I should do differently so this doesn't happen anymore?
Comment 1 Marco 2007-06-15 19:37:22 UTC
You have to request Spezial:Anmelden twice.

1) a normal HTTP request to *without* sending any form of cookies, POST or GET data
2) you get a session cookie. formed like this:
 Set-Cookie: dewiki_session=blablablablubblub; path=/
3) Take the cookie and remember it.
4) Send a HTTP POST request to with following details
- Take care of the action=submitlogin&type=login in the URI
- Send the dewiki_session cookie you just got
- The POST data: wpRemember=1&wpName=USER&wpPassword=PASSWORD&wpLoginattempt=Anmelden
- Of course replace the placeholders; do not forget to urlencode() them.
5) You get three additional cookies back with the success message:
Set-Cookie: dewikiUserID=blub; expires=Sun, 15-Jul-2007 19:15:55 GMT; path=/
Set-Cookie: dewikiUserName=blub; expires=Sun, 15-Jul-2007 19:15:55 GMT; path=/
Set-Cookie: dewikiToken=blubblubblabla; expires=Sun, 15-Jul-2007 19:15:55 GMT; path=/
6) Include these cookies AND the dewiki_session cookie you got in 2) at *EVERY* request you do, regardless if you read only or submit a edit. Note you *must not* take care of the EXPIRES attribute!

Comment 2 Chad H. 2009-12-09 15:04:47 UTC
Marking INVALID because A) partly seems like user error, B) WFM, C) because you should be using the API for bots by now and D) bugs in the API would go elsewhere.

Note You need to log in before you can comment on or make changes to this bug.