Symfony Session use session variables on Entity Forms -


in symfony2.7 have fosuserbundle user management in 'organization' entity field added selecting user's organization list on registration form.

there entity called 'year' set admin setting , getting active year.

we want: whenever user creates entry using entity based forms 'product', these 2 (organization id , year id) should inserted along user provided data can isolated organization's user has created product year.

should use session variables achieving this? if so, best way , place , set session variables after successful logins?

some snippets help..

thanks