Get access to session.custom from parent project

In my parent project, there's a view with button which will trigger a script which should read value from child project on this path (session.custom.projectProvider) .
When use this path in my parent project i got error global name 'session' is not defined in gateway setting i defined the parent project as gateway script project .

tagProviders = session.custom.projectProvider

That means you aren't trying to access it from within a view, as a parent project's views will only ever existing in a live project in their inherited forms in the leaf project.

Show where you are trying to use this and we may be able to help. Or at least, explain why you can't.