{"action":"created","issue":{"url":"https://api.github.com/repos/symphonycms/symphony-2/issues/2842","repository_url":"https://api.github.com/repos/symphonycms/symphony-2","labels_url":"https://api.github.com/repos/symphonycms/symphony-2/issues/2842/labels{/name}","comments_url":"https://api.github.com/repos/symphonycms/symphony-2/issues/2842/comments","events_url":"https://api.github.com/repos/symphonycms/symphony-2/issues/2842/events","html_url":"https://github.com/symphonycms/symphony-2/issues/2842","id":324725937,"number":2842,"title":"Session fails to set on subdomains.","user":{"login":"brendo","id":69268,"avatar_url":"https://avatars2.githubusercontent.com/u/69268?v=4","gravatar_id":"","url":"https://api.github.com/users/brendo","html_url":"https://github.com/brendo","followers_url":"https://api.github.com/users/brendo/followers","following_url":"https://api.github.com/users/brendo/following{/other_user}","gists_url":"https://api.github.com/users/brendo/gists{/gist_id}","starred_url":"https://api.github.com/users/brendo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendo/subscriptions","organizations_url":"https://api.github.com/users/brendo/orgs","repos_url":"https://api.github.com/users/brendo/repos","events_url":"https://api.github.com/users/brendo/events{/privacy}","received_events_url":"https://api.github.com/users/brendo/received_events","type":"User","site_admin":false},"labels":[{"id":115197,"url":"https://api.github.com/repos/symphonycms/symphony-2/labels/2%20-%20Nominal","name":"2 - Nominal","color":"d7e102","default":false}],"state":"open","locked":false,"assignee":{"login":"nitriques","id":771169,"avatar_url":"https://avatars1.githubusercontent.com/u/771169?v=4","gravatar_id":"","url":"https://api.github.com/users/nitriques","html_url":"https://github.com/nitriques","followers_url":"https://api.github.com/users/nitriques/followers","following_url":"https://api.github.com/users/nitriques/following{/other_user}","gists_url":"https://api.github.com/users/nitriques/gists{/gist_id}","starred_url":"https://api.github.com/users/nitriques/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nitriques/subscriptions","organizations_url":"https://api.github.com/users/nitriques/orgs","repos_url":"https://api.github.com/users/nitriques/repos","events_url":"https://api.github.com/users/nitriques/events{/privacy}","received_events_url":"https://api.github.com/users/nitriques/received_events","type":"User","site_admin":false},"assignees":[{"login":"nitriques","id":771169,"avatar_url":"https://avatars1.githubusercontent.com/u/771169?v=4","gravatar_id":"","url":"https://api.github.com/users/nitriques","html_url":"https://github.com/nitriques","followers_url":"https://api.github.com/users/nitriques/followers","following_url":"https://api.github.com/users/nitriques/following{/other_user}","gists_url":"https://api.github.com/users/nitriques/gists{/gist_id}","starred_url":"https://api.github.com/users/nitriques/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nitriques/subscriptions","organizations_url":"https://api.github.com/users/nitriques/orgs","repos_url":"https://api.github.com/users/nitriques/repos","events_url":"https://api.github.com/users/nitriques/events{/privacy}","received_events_url":"https://api.github.com/users/nitriques/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/symphonycms/symphony-2/milestones/19","html_url":"https://github.com/symphonycms/symphony-2/milestone/19","labels_url":"https://api.github.com/repos/symphonycms/symphony-2/milestones/19/labels","id":736848,"number":19,"title":"3.0.0","description":"","creator":{"login":"brendo","id":69268,"avatar_url":"https://avatars2.githubusercontent.com/u/69268?v=4","gravatar_id":"","url":"https://api.github.com/users/brendo","html_url":"https://github.com/brendo","followers_url":"https://api.github.com/users/brendo/followers","following_url":"https://api.github.com/users/brendo/following{/other_user}","gists_url":"https://api.github.com/users/brendo/gists{/gist_id}","starred_url":"https://api.github.com/users/brendo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendo/subscriptions","organizations_url":"https://api.github.com/users/brendo/orgs","repos_url":"https://api.github.com/users/brendo/repos","events_url":"https://api.github.com/users/brendo/events{/privacy}","received_events_url":"https://api.github.com/users/brendo/received_events","type":"User","site_admin":false},"open_issues":45,"closed_issues":43,"state":"open","created_at":"2014-07-30T10:51:47Z","updated_at":"2018-05-23T19:14:38Z","due_on":null,"closed_at":null},"comments":4,"created_at":"2018-05-20T17:26:05Z","updated_at":"2018-05-23T20:12:49Z","closed_at":null,"author_association":"MEMBER","body":"Affected Symphony version(s) : 2.7.6\r\nPHP version(s) : 5.5.19 (haven't tested 7 yet)\r\n\r\nEncountered a scenario today that was a little tricky to repeat:\r\n\r\n- Main domain, `https://www.example.org`\r\n- Dev domain, `http://dev.example.org`\r\n\r\n1. Login to Symphony on the main domain ✔️ \r\n2. Login to Symphony on the dev domain 🙅‍♂️ \r\n3. Logout of Symphony on the main domain\r\n4. Login to Symphony on the dev domain ✔️ \r\n5. Login to Symphony on the main domain 🙅‍♂️ \r\n\r\nThe reason behind this weirdness appears to be the [`session.name`](http://us1.php.net/manual/en/function.session-name.php) setting. We don't set it in Symphony at all, so by default it is `PHPSESSID`.\r\n\r\nWhen we attempt to login on the dev domain, it won't replace the cookie that was set previously (not too sure why?), so the login fails. You can see in the database that the session is actually created correctly, but the cookie just won't be set.\r\n\r\nTo fix it I set the `session.name` (just hardcoded it to a different string).\r\n\r\nFor a long term fix, perhaps we should set this value using the `getDomain()` method? The return value would need to be cleaned up to be [alphanumeric](http://us1.php.net/manual/en/session.configuration.php#ini.session.name) but it should solve the issue..."},"comment":{"url":"https://api.github.com/repos/symphonycms/symphony-2/issues/comments/391480928","html_url":"https://github.com/symphonycms/symphony-2/issues/2842#issuecomment-391480928","issue_url":"https://api.github.com/repos/symphonycms/symphony-2/issues/2842","id":391480928,"user":{"login":"brendo","id":69268,"avatar_url":"https://avatars2.githubusercontent.com/u/69268?v=4","gravatar_id":"","url":"https://api.github.com/users/brendo","html_url":"https://github.com/brendo","followers_url":"https://api.github.com/users/brendo/followers","following_url":"https://api.github.com/users/brendo/following{/other_user}","gists_url":"https://api.github.com/users/brendo/gists{/gist_id}","starred_url":"https://api.github.com/users/brendo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brendo/subscriptions","organizations_url":"https://api.github.com/users/brendo/orgs","repos_url":"https://api.github.com/users/brendo/repos","events_url":"https://api.github.com/users/brendo/events{/privacy}","received_events_url":"https://api.github.com/users/brendo/received_events","type":"User","site_admin":false},"created_at":"2018-05-23T20:12:49Z","updated_at":"2018-05-23T20:12:49Z","author_association":"MEMBER","body":"> @brendo, are you sure that your problems were not simply caused by the fact that one of the domains was running with SSL, the other did not? (In this case you will have a \"secure\" cookie on the first domain, which may cause your issues.)\r\n\r\nThat could definitely be the case. Will retest once I get SSL on the subdomain!"}}
{"actor":{"display_login":"brendo"}}