Hi, Recently I have been rebuilding one of my applications in PHP using the MVC (module view controller) Design Pattern. The design seems to work really well and the code is really clean but i'm not exactly sure where I should be accessing session data from. I've read that the model should not have direct access to it, instead the controller will just pass the specific value to wherever it needs to be accessed within the model. Anyone care to give examples of how they deal with Session data in the MVC based Applications? One can always read and has read but others opinions would be nice right now... Thanks --
I haven't played with MVC in PHP but in Java I would have the Controller populate the Model with all data that it requires. You can pass the session data just like any other data you would pass from the Controller to the Model. $ctrl->setSomeValue($_SESSION['someValue']); // nothing wrong with that