I was wondering what the best way is for storing and retrieving session values in PHP. I am building a php framework with an MVC structure. Now i have a registry class with inmportant object.
I have a class for the session, with some defined functions concerning the session. Now I was wondering if it is a good practice to just use
$_SESSION['something']
everywhere in your code. Or should i use set and get methods in the session object class. If i do so it would look something like
$session->something = 4
$myalue = $session->something
I know this is not a big deal, but i was just wondering what the best practice is for such a thing in a good architecture.
Thank you!