{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/10255","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/10255/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/10255/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/10255/events","html_url":"https://github.com/yiisoft/yii2/issues/10255","id":118972923,"number":10255,"title":"about session component","user":{"login":"quorzz","id":15520129,"avatar_url":"https://avatars.githubusercontent.com/u/15520129?v=3","gravatar_id":"","url":"https://api.github.com/users/quorzz","html_url":"https://github.com/quorzz","followers_url":"https://api.github.com/users/quorzz/followers","following_url":"https://api.github.com/users/quorzz/following{/other_user}","gists_url":"https://api.github.com/users/quorzz/gists{/gist_id}","starred_url":"https://api.github.com/users/quorzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quorzz/subscriptions","organizations_url":"https://api.github.com/users/quorzz/orgs","repos_url":"https://api.github.com/users/quorzz/repos","events_url":"https://api.github.com/users/quorzz/events{/privacy}","received_events_url":"https://api.github.com/users/quorzz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-26T05:05:20Z","updated_at":"2015-11-26T05:11:08Z","closed_at":null,"body":"Of course,  the best practice is use `Yii::$app->session` or cookie instead of handle with `$_COOKIE $_SESSION ...` directly.\r\n\r\nbut (yes, here is a but ) , if by any chance,  one call `session_start` before that called by `Yii`. \r\n\r\nfor example, call `session_start` in the entry file or somewhere else ,\r\n\r\nthis will prevent the session component  to  `registerSessionHandler` `updateFlashCounters` .... \r\n\r\nthen the session component no longer works well,\r\n\r\nand in this case,  the bug is difficult to pull out.\r\n\r\nso maybe we can give a detect at first `session_start` in `\\yii\\web\\Session` ?\r\n"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/159808022","html_url":"https://github.com/yiisoft/yii2/issues/10255#issuecomment-159808022","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/10255","id":159808022,"user":{"login":"quorzz","id":15520129,"avatar_url":"https://avatars.githubusercontent.com/u/15520129?v=3","gravatar_id":"","url":"https://api.github.com/users/quorzz","html_url":"https://github.com/quorzz","followers_url":"https://api.github.com/users/quorzz/followers","following_url":"https://api.github.com/users/quorzz/following{/other_user}","gists_url":"https://api.github.com/users/quorzz/gists{/gist_id}","starred_url":"https://api.github.com/users/quorzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quorzz/subscriptions","organizations_url":"https://api.github.com/users/quorzz/orgs","repos_url":"https://api.github.com/users/quorzz/repos","events_url":"https://api.github.com/users/quorzz/events{/privacy}","received_events_url":"https://api.github.com/users/quorzz/received_events","type":"User","site_admin":false},"created_at":"2015-11-26T05:11:08Z","updated_at":"2015-11-26T05:11:08Z","body":"In short,  call `session_start`  by developers maybe lead to errors of session component...\r\n\r\nMaybe `Yii` can throw an exception or other handle in this case ?"}}