In GF2 in order to use Sessions we should use this
use ZendSessionContainer; class. This class Container extends of ArrayObject and instantiates with ARRAY_AS_PROPS flag that means you can easily iterate through properties and read/write them.
After Placing above line of code in place , you need to instantiate the ZendSessionContainer class and pass a name to the constructor (name is optional).
$session = new Container('user');
How to set value in session
How to Read or Get Session Value By Key
$email = $session->offsetGet('username');
How to Check for key exists in session
I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.