protected function setSessionData(string $key, $val)
    {
        if (method_exists($this->getSession(), 'put')) {
            return $this->getSession()->put($key, $val);
        } elseif (method_exists($this->getSession(), 'set')) {
            return $this->getSession()->set($key, $val);
        } elseif (method_exists($this->getSession(), 'write')) {
            return $this->getSession()->write($key, $val);
        }

        return false;
    }
protected function setSessionData(string $key, $val)
    {
        if (method_exists($this->getSession(), 'put')) {
            return $this->getSession()->put($key, $val);
        } elseif (method_exists($this->getSession(), 'set')) {
            return $this->getSession()->set($key, $val);
        } elseif (method_exists($this->getSession(), 'write')) {
            return $this->getSession()->write($key, $val);
        }

        return false;
    }
protected function setSessionData ( string $ key , $ val ) { if ( method_exists ( $ this -> getSession ( ) , 'put' ) ) { return $ this -> getSession ( ) -> put ( $ key , $ val ) ; } elseif ( method_exists ( $ this -> getSession ( ) , 'set' ) ) { return $ this -> getSession ( ) -> set ( $ key , $ val ) ; } elseif ( method_exists ( $ this -> getSession ( ) , 'write' ) ) { return $ this -> getSession ( ) -> write ( $ key , $ val ) ; } return false ; }
Set Session data

@param string $key
@param mixed $val
@return bool|mixed
Set Session data