{"action":"created","issue":{"url":"https://api.github.com/repos/DoctorMcKay/node-steam-tradeoffer-manager/issues/28","labels_url":"https://api.github.com/repos/DoctorMcKay/node-steam-tradeoffer-manager/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/DoctorMcKay/node-steam-tradeoffer-manager/issues/28/comments","events_url":"https://api.github.com/repos/DoctorMcKay/node-steam-tradeoffer-manager/issues/28/events","html_url":"https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/issues/28","id":116652692,"number":28,"title":"Detecting invalid cookies","user":{"login":"scholtzm","id":2640934,"avatar_url":"https://avatars.githubusercontent.com/u/2640934?v=3","gravatar_id":"","url":"https://api.github.com/users/scholtzm","html_url":"https://github.com/scholtzm","followers_url":"https://api.github.com/users/scholtzm/followers","following_url":"https://api.github.com/users/scholtzm/following{/other_user}","gists_url":"https://api.github.com/users/scholtzm/gists{/gist_id}","starred_url":"https://api.github.com/users/scholtzm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scholtzm/subscriptions","organizations_url":"https://api.github.com/users/scholtzm/orgs","repos_url":"https://api.github.com/users/scholtzm/repos","events_url":"https://api.github.com/users/scholtzm/events{/privacy}","received_events_url":"https://api.github.com/users/scholtzm/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/DoctorMcKay/node-steam-tradeoffer-manager/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2015-11-12T22:12:23Z","updated_at":"2015-12-16T16:19:13Z","closed_at":null,"body":"Tradeoffer manager is currently detecting certain cases, when the trade offer simply cannot be sent/accepted, e.g. `NewDevice`. However, it's still not detecting invalid cookies.\r\n\r\nIf cookies become invalid, it's impossible to accept or send any trade offer without \"refreshing\" the cookies.\r\n\r\nManager currently does this:\r\n\r\n- when accepting trade offer, manager will return error \"HTTP error 403\". If auto-retry is enabled, manager will attempt to repeatedly accept the trade offer even though it's impossible\r\n- when sending trade offer, manager will emit error \"HTTP error 401\"\r\n\r\nIt's possible to detect invalid cookies by checking the response from `request` module. In both cases, the `cookie` header will no longer contain `steamLogin` nor `steamLoginSecure` cookies.\r\n\r\nIt would be great if manager detected these cases and provided appropriate `error.cause`.\r\n\r\nHere's my [testing script](https://gist.github.com/scholtzm/65facbd95814f8e20c76)."},"comment":{"url":"https://api.github.com/repos/DoctorMcKay/node-steam-tradeoffer-manager/issues/comments/165162676","html_url":"https://github.com/DoctorMcKay/node-steam-tradeoffer-manager/issues/28#issuecomment-165162676","issue_url":"https://api.github.com/repos/DoctorMcKay/node-steam-tradeoffer-manager/issues/28","id":165162676,"user":{"login":"dnowitski69","id":15443852,"avatar_url":"https://avatars.githubusercontent.com/u/15443852?v=3","gravatar_id":"","url":"https://api.github.com/users/dnowitski69","html_url":"https://github.com/dnowitski69","followers_url":"https://api.github.com/users/dnowitski69/followers","following_url":"https://api.github.com/users/dnowitski69/following{/other_user}","gists_url":"https://api.github.com/users/dnowitski69/gists{/gist_id}","starred_url":"https://api.github.com/users/dnowitski69/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dnowitski69/subscriptions","organizations_url":"https://api.github.com/users/dnowitski69/orgs","repos_url":"https://api.github.com/users/dnowitski69/repos","events_url":"https://api.github.com/users/dnowitski69/events{/privacy}","received_events_url":"https://api.github.com/users/dnowitski69/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T16:19:13Z","updated_at":"2015-12-16T16:19:13Z","body":"Thank you for your reply.\r\n\r\nI've been calling logOff to simulate the error however this will disconnect the bot from Steam network and will require logOn; webSession will not suffice in this case.\r\n\r\nIs there any way to simulate an invalid session by destroying the cookies?"}}