Add input to a form

I had to add an input to this form

$sess = CakeSession::read(‘Auth’);

                    echo $this->Form->create('Exportaffiliate', ['class' => 'form-horizontal']);
                    echo $this->Form->input('id');
                    echo '<div class="col-lg-6">' . $this->Form->input('subject', ['label' => __('Offer Subject')]) . '</div><div class="col-lg-6"></div>';
                    echo '<div class="col-lg-12">' . $this->Form->input('description', ['label' => 'Description of your offer', 'rows' => 12]) . '</div>';
                    echo $this->Form->input('user_id', ['type' => 'hidden', 'value' => $sess['User']['id']]);

                    //t0m dev inserisce nel form il valore del gruppo d'appartenenza dell'utente che crea
                    echo $sess['User']['group_id'];
                    echo $this->Form->input('user_group_id', ['type' => 'hidden', 'value' => $sess['User']['group_id']]);

                    $opt = [
                              'label' => \__('Save').' &#8250;',
                              'class' => 'btn btn-primary',
                              'escape' => false
                          ];
                    echo '<div class="col-lg-6">' . $this->Form->end($opt) .'</div>';

Tried to add the line of my interest:
echo $this->Form->input('user_group_id', ['type' => 'hidden', 'value' => $sess['User']['group_id']]);

But the value can’t be echoed then. I tried to echo like this but it echos nothing.
echo '<div class="col-lg-6">'.$this->Form->value('user_group_id').'</div>';

Where did you get this from ?

In cakephp 3.x you should have something like :
$this->request->session()->read(‘Auth.User.group_id’);

Thank you for your reply. Maybe I’m not on v3.x.
Well, anyway, $sess[…] works elsewhere. I’ll try, but I think that this has something concerning with forms. For example, can I add an input on a form without creating a referred column on the that form’s db table??

No problem ! Of course you can.

What does :
debug($sess) return ?

I don’t think I’m having nothing to debug ($sess): as you see, on the working code, there is already an input based on $sess, and it’s working.

Today I want to add an input on the form, but form won’t take it! Maybe also because db table is not ready to receive it?..

Nothing to do with the table. You can add as many inputs you need.

But how do the form “add” a new field on db’s table (based on my new $this->Form->input(‘xxx’)?
And how do it setup that field type?

The field is not added to the table.
These fields are used for extra information or verification (search term, password confim …).
They are not saved in the DB.

Well, actually I want to save that on db, as the most part of that form inputs.