{"action":"created","issue":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2803","labels_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2803/labels{/name}","comments_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2803/comments","events_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2803/events","html_url":"https://github.com/Starcounter/Starcounter/issues/2803","id":93778426,"number":2803,"title":"Invalid session sent from the gateway to the codehost even though a session exists.","user":{"login":"chrhol","id":1658979,"avatar_url":"https://avatars.githubusercontent.com/u/1658979?v=3","gravatar_id":"","url":"https://api.github.com/users/chrhol","html_url":"https://github.com/chrhol","followers_url":"https://api.github.com/users/chrhol/followers","following_url":"https://api.github.com/users/chrhol/following{/other_user}","gists_url":"https://api.github.com/users/chrhol/gists{/gist_id}","starred_url":"https://api.github.com/users/chrhol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chrhol/subscriptions","organizations_url":"https://api.github.com/users/chrhol/orgs","repos_url":"https://api.github.com/users/chrhol/repos","events_url":"https://api.github.com/users/chrhol/events{/privacy}","received_events_url":"https://api.github.com/users/chrhol/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/bug","name":"bug","color":"e11d21"},{"url":"https://api.github.com/repos/Starcounter/Starcounter/labels/Gateway","name":"Gateway","color":"000000"}],"state":"open","locked":false,"assignee":{"login":"alemoi","id":208134,"avatar_url":"https://avatars.githubusercontent.com/u/208134?v=3","gravatar_id":"","url":"https://api.github.com/users/alemoi","html_url":"https://github.com/alemoi","followers_url":"https://api.github.com/users/alemoi/followers","following_url":"https://api.github.com/users/alemoi/following{/other_user}","gists_url":"https://api.github.com/users/alemoi/gists{/gist_id}","starred_url":"https://api.github.com/users/alemoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alemoi/subscriptions","organizations_url":"https://api.github.com/users/alemoi/orgs","repos_url":"https://api.github.com/users/alemoi/repos","events_url":"https://api.github.com/users/alemoi/events{/privacy}","received_events_url":"https://api.github.com/users/alemoi/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-07-08T12:37:50Z","updated_at":"2015-07-09T18:45:15Z","closed_at":null,"body":"When session is specified as parameter in the uri, the gateway sometimes overwrites correct sessioninfo in the datablob with invalid values which leads to an IncorrectSessionException in the codehost.\r\n\r\nAs far as I understand, this happens when the referer (or x-referer) headers have a value of a specific length.\r\n\r\nThe following condition will be true even though it shouldn't (in http_proto.OnHeaderValue)\r\n\r\n```c++\r\nif ((MixedCodeConstants::SESSION_STRING_LEN_CHARS < length) &&\r\n      (*(session_id_start - 1) == '/'))\r\n```\r\n\r\nCan be reproduced by running the Products-app only and calling [http://localhost:8080/products](http://localhost:8080/products) from a browser.\r\n\r\nReported originally in https://github.com/Polyjuice/Products/issues/4\r\n\r\nI will assign it to @alemoi  even though hes on vacation. If this gets more urgent I might try to fix it but I rather not if possible :)"},"comment":{"url":"https://api.github.com/repos/Starcounter/Starcounter/issues/comments/120102489","html_url":"https://github.com/Starcounter/Starcounter/issues/2803#issuecomment-120102489","issue_url":"https://api.github.com/repos/Starcounter/Starcounter/issues/2803","id":120102489,"user":{"login":"alemoi","id":208134,"avatar_url":"https://avatars.githubusercontent.com/u/208134?v=3","gravatar_id":"","url":"https://api.github.com/users/alemoi","html_url":"https://github.com/alemoi","followers_url":"https://api.github.com/users/alemoi/followers","following_url":"https://api.github.com/users/alemoi/following{/other_user}","gists_url":"https://api.github.com/users/alemoi/gists{/gist_id}","starred_url":"https://api.github.com/users/alemoi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alemoi/subscriptions","organizations_url":"https://api.github.com/users/alemoi/orgs","repos_url":"https://api.github.com/users/alemoi/repos","events_url":"https://api.github.com/users/alemoi/events{/privacy}","received_events_url":"https://api.github.com/users/alemoi/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T18:45:15Z","updated_at":"2015-07-09T18:45:15Z","body":"I went through the specs in https://github.com/Starcounter/Starcounter/issues/2713\r\nand for `Referer` and `X-Referer` I follow the formats from there (e.g. `X-Referer: 35AA181932856ED910000000`)."}}