I have got the error above after I have added a helper to the AppController. If I added the similar helper to all of my Controllers, everything had worked fine. Of course it is a workaround, so I have did some investigation, and I have figured out that the Session also acts as a helper not just as a component. After adding the Session to the helpers of the AppController the problem gone away.