# Reading a session variable from a python scipt

**URL:** <https://forum.inductiveautomation.com/t/reading-a-session-variable-from-a-python-scipt/38760>\
**Category:** Ignition\
**Tags:** ignition80\
**Created:** [September 16, 2020, 6:22pm UTC](https://forum.inductiveautomation.com/t/reading-a-session-variable-from-a-python-scipt/38760 "2020-09-16T18:22:48Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![Greg.Bogard](https://avatars.discourse-cdn.com/v4/letter/g/76d3ee/32.png) [@Greg.Bogard](https://forum.inductiveautomation.com/u/Greg.Bogard)\
**Post date:** [September 16, 2020, 8:33pm UTC](https://forum.inductiveautomation.com/t/reading-a-session-variable-from-a-python-scipt/38760/6 "2020-09-16T20:33:38Z")

</div>

> [@\[16426\] Incorrect SessionID from system.perspective.getSessionInfo()](https://forum.inductiveautomation.com/t/16426-incorrect-sessionid-from-system-perspective-getsessioninfo/34036/3):
>
> calling `self.sesion.info.id`

Not having any luck capturing the session to pass to a function in a python library, trying to use the:  
logger.info('''self.sesion.info.id : ''' + str(self.sesion.info.id))  
returns nothing, in fact in the code in a button component on a perspective view, it does not show anything and does not throw and error.  
any suggestions?

Tried a few ways to get the session...  
i.e.

# logger.info('system.perspective.getSessionInfo(id): ' + str(system.perspective.getSessionInfo(id)))

# logger.info('session.props.id: ' + str(session.props.id))

# logger.info('session.pageId: ' + str(session.pageId))

# logger.info('session: ' + str(session))

# logger.info('self.session.info(id): ' + str(self.session.info(id)))

# logger.info('''self.session.info('id'): ''' + str(self.session.info('id')))

```
			logger.info('Hello Line 43: ')
			logger.info('''self.sesion.info.id : ''' + str(self.sesion.info.id))

```

---

_[View the full topic](https://forum.inductiveautomation.com/t/reading-a-session-variable-from-a-python-scipt/38760)._
