Sessions and Plugins

18 August, 2006

Show comments

If you use plugins, you may have noticed that your app session data isn't avaialbe in your plugins and vice-versa. There's a good reason for that, as a plugin is intended to be a mini application, self contained etc.

In my case, this was a problem as my plugins are extensions or parts of my application and not seperate. To get around the wandering session data it was necessary to copy the session helper from cake/libs/controllers/components/ to /app/controllers/components and change this line in the constructor method:

       //$this->CakeSession = new 

        $this->CakeSession = new CakeSession("/");

.. and in that way my session applies to everything under my app folder.