I am trying to achieve this. I have session manager class, its something I developed for my framework. I need to have unique session keys, so instead of doing something like this:
$_SESSION['foo'] = $bar;
I do this:
Session::set('foo',$bar);
and the set function will do something like this:
$_SESSION[$unique.'foo'] = $bar;
Its nice, it works, but I would like to use it like this:
Session['foo'] = $bar
or like this:
Session->foo = $bar
I found that I cant use -> in static objects, and I also cant use magic functions like __set and __get. So, is there any way how can I achieve this behavior?
Make your session class a singleton?
And then use it like so: