[01:57:51] Amir1: if you mean you want your browser to plant session cookies on Wiki B without going there so that they're there next time you do visit, I'm not sure that's possible. The way to do it, as a user, is visit Wiki B and you'll either 1) be auto logged in because when you logged in to wiki A you'll have been given cookies for all major wildcard domains that likely cover wiki B already without needing to visit it, or 2) you click Log in [01:57:51] and that redirects you through loginwiki where there's a session active from when you logged in on A, which then bounces you back to B with enough data in query params to materials a new session for you [01:58:18] ForeignApi should let you make a request via JS without needing to be "logged in" there at the UI level though [01:58:46] Or do you mean a wiki where even your account doesn't exist. Like, never visited ever. [01:59:13] And you want to auto create via JS, and then make an API call to read write something? [02:00:09] ForeignApi uses the centralauthtoken which lets you make cross domain requests without needing a Ui login session. [02:00:28] Think of it as a very crude bot password or oauth. [02:01:05] Or perhaps more sensible, it's like a cookie without a cookie. [02:02:07] This is failing if the user hasn't visited the wiki after login: [02:02:07] let api = new mw.ForeignApi( apiUrl ); [02:02:18] https://www.irccloud.com/pastebin/IJmfBuck/ [02:03:18] I want the assert to pass [02:03:52] And subsequent API calls to happen (editing pages etc.) [02:04:42] The user exists, that's given [03:23:23] https://en.wikipedia.org/wiki/Special:Blankpage/ [03:23:25] https://en.wikipedia.org/wiki/Special:Blankpage/ [03:23:28] var api = new mw.ForeignApi('https://zh.wikibooks.org/w/api.php') [03:23:57] await api.get( action: 'query', meta: 'userinfo', assert: 'user' } ); [03:24:11] await api.get( { action: 'query', meta: 'userinfo', assert: 'user' } ); [03:24:21] /> userinfo: Object { id: 11010, name: "Krinkle" } [03:24:49] I checked cookies first and deleted any for wikibooks first (there was an old session on enwikibooks, not zhwikibooks, but either way all gone before I ran this) [03:25:13] Network: [03:26:22] 1) https://zh.wikibooks.org/w/api.php?action=query&format=json&origin=https://en.wikipedia.org&meta=userinfo|tokens (response: I'm anon) [03:26:23] 2) https://en.wikipedia.org/w/api.php?action=centralauthtoken&format=json [03:26:32] 3) https://zh.wikibooks.org/w/api.php?action=query&format=json&origin=https://en.wikipedia.org¢ralauthtoken=***&meta=userinfo&assert=user [03:27:05] Amir1: what's the network activity in your case look like?