{"action":"created","issue":{"url":"https://api.github.com/repos/meteor/meteor/issues/4286","labels_url":"https://api.github.com/repos/meteor/meteor/issues/4286/labels{/name}","comments_url":"https://api.github.com/repos/meteor/meteor/issues/4286/comments","events_url":"https://api.github.com/repos/meteor/meteor/issues/4286/events","html_url":"https://github.com/meteor/meteor/issues/4286","id":71465084,"number":4286,"title":"Can't resume to log in remote ddp account server with token when refresh the page.","user":{"login":"lzl","id":41784,"avatar_url":"https://avatars.githubusercontent.com/u/41784?v=3","gravatar_id":"","url":"https://api.github.com/users/lzl","html_url":"https://github.com/lzl","followers_url":"https://api.github.com/users/lzl/followers","following_url":"https://api.github.com/users/lzl/following{/other_user}","gists_url":"https://api.github.com/users/lzl/gists{/gist_id}","starred_url":"https://api.github.com/users/lzl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lzl/subscriptions","organizations_url":"https://api.github.com/users/lzl/orgs","repos_url":"https://api.github.com/users/lzl/repos","events_url":"https://api.github.com/users/lzl/events{/privacy}","received_events_url":"https://api.github.com/users/lzl/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/meteor/meteor/labels/Project:Accounts:Password","name":"Project:Accounts:Password","color":"fad8c7"},{"url":"https://api.github.com/repos/meteor/meteor/labels/Project:DDP","name":"Project:DDP","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2015-04-28T03:16:10Z","updated_at":"2015-07-06T12:00:08Z","closed_at":"2015-04-29T00:08:19Z","body":"I think this issue is related with `Project:Accounts:Password` and `Project:DDP`.\r\n\r\nI set up a server `http://localhost:3000` and a client `http://localhost:4000`.\r\n\r\nThe client connect server via ddp. Code:\r\n\r\n````js\r\nvar connection = DDP.connect(\"http://localhost:3000\");\r\nAccounts.connection = connection;\r\nMeteor.users = new Mongo.Collection(\"users\", {connection: connection});\r\n````\r\n\r\nThen add `accounts-password` and `accounts-ui` packages and set up `{{> loginButtons}}`.\r\n\r\nI logged in at `http://localhost:4000` client successfully. At browser console, the result of `Meteor.userId` is the same at `http://localhost:3000` server.\r\n\r\nEverything is fine. Except...\r\n\r\nExcept if I refresh the page. My account is logged out automatically. At browser console, it shows:\r\n\r\n`Error logging in with token: Error: You've been logged out by the server. Please log in again. [403]`\r\n\r\nHow to resolve this problem?\r\n\r\nSide note 1: When I refresh the page, the `Meteor.loginToken` and other two at Local Storage are removed.\r\n\r\nSide note 2: Every about ten minutes, the terminal console of `http://localhost:4000` shows:\r\n\r\n```\r\nI20150428-10:59:29.387(8)? Exception in setInterval callback: Error: Not permitted. Untrusted code may only update documents by ID. [403]\r\nI20150428-10:59:29.390(8)?     at throwIfSelectorIsNotId (packages/mongo/collection.js:380:1)\r\nI20150428-10:59:29.390(8)?     at [object Object].Mongo.Collection.(anonymous function) [as update] (packages/mongo/collection.js:560:1)\r\nI20150428-10:59:29.391(8)?     at Accounts._expireTokens (packages/accounts-base/accounts_server.js:858:1)\r\nI20150428-10:59:29.391(8)?     at [object Object]._.extend.withValue (packages/meteor/dynamics_nodejs.js:56:1)\r\nI20150428-10:59:29.391(8)?     at packages/meteor/timers.js:6:1\r\nI20150428-10:59:29.391(8)?     at runWithEnvironment (packages/meteor/dynamics_nodejs.js:108:1)\r\n```"},"comment":{"url":"https://api.github.com/repos/meteor/meteor/issues/comments/118833109","html_url":"https://github.com/meteor/meteor/issues/4286#issuecomment-118833109","issue_url":"https://api.github.com/repos/meteor/meteor/issues/4286","id":118833109,"user":{"login":"mahiagit","id":5791212,"avatar_url":"https://avatars.githubusercontent.com/u/5791212?v=3","gravatar_id":"","url":"https://api.github.com/users/mahiagit","html_url":"https://github.com/mahiagit","followers_url":"https://api.github.com/users/mahiagit/followers","following_url":"https://api.github.com/users/mahiagit/following{/other_user}","gists_url":"https://api.github.com/users/mahiagit/gists{/gist_id}","starred_url":"https://api.github.com/users/mahiagit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mahiagit/subscriptions","organizations_url":"https://api.github.com/users/mahiagit/orgs","repos_url":"https://api.github.com/users/mahiagit/repos","events_url":"https://api.github.com/users/mahiagit/events{/privacy}","received_events_url":"https://api.github.com/users/mahiagit/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T12:00:08Z","updated_at":"2015-07-06T12:00:08Z","body":"Yes i was also facing the same stuck in which the logged is user logged out as refresh the page. the scenario is same as expressed above . Any body have some clue.."}}