{"action":"created","issue":{"url":"https://api.github.com/repos/request/request/issues/1405","labels_url":"https://api.github.com/repos/request/request/issues/1405/labels{/name}","comments_url":"https://api.github.com/repos/request/request/issues/1405/comments","events_url":"https://api.github.com/repos/request/request/issues/1405/events","html_url":"https://github.com/request/request/issues/1405","id":56581599,"number":1405,"title":"Cookies from domain aren't being sent to subdomain","user":{"login":"MadaraUchiha","id":1188951,"avatar_url":"https://avatars.githubusercontent.com/u/1188951?v=3","gravatar_id":"","url":"https://api.github.com/users/MadaraUchiha","html_url":"https://github.com/MadaraUchiha","followers_url":"https://api.github.com/users/MadaraUchiha/followers","following_url":"https://api.github.com/users/MadaraUchiha/following{/other_user}","gists_url":"https://api.github.com/users/MadaraUchiha/gists{/gist_id}","starred_url":"https://api.github.com/users/MadaraUchiha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadaraUchiha/subscriptions","organizations_url":"https://api.github.com/users/MadaraUchiha/orgs","repos_url":"https://api.github.com/users/MadaraUchiha/repos","events_url":"https://api.github.com/users/MadaraUchiha/events{/privacy}","received_events_url":"https://api.github.com/users/MadaraUchiha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"lalitkapoor","id":140436,"avatar_url":"https://avatars.githubusercontent.com/u/140436?v=3","gravatar_id":"","url":"https://api.github.com/users/lalitkapoor","html_url":"https://github.com/lalitkapoor","followers_url":"https://api.github.com/users/lalitkapoor/followers","following_url":"https://api.github.com/users/lalitkapoor/following{/other_user}","gists_url":"https://api.github.com/users/lalitkapoor/gists{/gist_id}","starred_url":"https://api.github.com/users/lalitkapoor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lalitkapoor/subscriptions","organizations_url":"https://api.github.com/users/lalitkapoor/orgs","repos_url":"https://api.github.com/users/lalitkapoor/repos","events_url":"https://api.github.com/users/lalitkapoor/events{/privacy}","received_events_url":"https://api.github.com/users/lalitkapoor/received_events","type":"User","site_admin":false},"milestone":null,"comments":4,"created_at":"2015-02-04T20:19:30Z","updated_at":"2015-03-23T19:22:54Z","closed_at":null,"body":"I wrote a piece of code that uses cookies and multiple requests for authentication purposes, the requests span over two domains, example.com and subdomain.example.com.\r\n\r\nI noticed that cookies from example.com aren't available on subdomain.example.com.\r\n\r\nThat behavior is, if I read it correctly, against HTTP specs which specifies that if no domain was set, the cookie should be available to this domain and every subdomain under it."},"comment":{"url":"https://api.github.com/repos/request/request/issues/comments/85156452","html_url":"https://github.com/request/request/issues/1405#issuecomment-85156452","issue_url":"https://api.github.com/repos/request/request/issues/1405","id":85156452,"user":{"login":"MadaraUchiha","id":1188951,"avatar_url":"https://avatars.githubusercontent.com/u/1188951?v=3","gravatar_id":"","url":"https://api.github.com/users/MadaraUchiha","html_url":"https://github.com/MadaraUchiha","followers_url":"https://api.github.com/users/MadaraUchiha/followers","following_url":"https://api.github.com/users/MadaraUchiha/following{/other_user}","gists_url":"https://api.github.com/users/MadaraUchiha/gists{/gist_id}","starred_url":"https://api.github.com/users/MadaraUchiha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MadaraUchiha/subscriptions","organizations_url":"https://api.github.com/users/MadaraUchiha/orgs","repos_url":"https://api.github.com/users/MadaraUchiha/repos","events_url":"https://api.github.com/users/MadaraUchiha/events{/privacy}","received_events_url":"https://api.github.com/users/MadaraUchiha/received_events","type":"User","site_admin":false},"created_at":"2015-03-23T19:22:54Z","updated_at":"2015-03-23T19:22:54Z","body":"@lalitkapoor Again, per HTTP specs, if no domain is defined, the expected behavior is to allow the cookie one subdomain level down. AFAIK, all browser do this (mainly because the specific action I'm trying to do with request doesn't fail in any browser I've tried, and I've tried them all).\r\n\r\nAs an addendum, documentation is seriously lacking in that field. Benjamin ended up finding it, but both of us had to scourge the source of both request and tough-cookie to get any sort of information as to why it happens.\r\n\r\nWorth noting that the c.hostOnly option is documented in tough-cookie, but it doesn't explain what sort of effect it has on the cookie. "}}