PostgreSQL does not "store" the session_id per se in any system catalogs/tables, however, you can configure the log_line_prefix in postgresql.conf to record it for each connection. It will then be stored in the postgresql log file.
Please not that in the future, it is always helpful to provide the exact version of PostgreSQL and the O/S you are working with.