Fix session_id bug

This commit will fix the bug with session_id() described here: https://github.com/yiisoft/yii2/pull/6634#issuecomment-67988858