title: Streamlit AttributeError: 'NoneType' object has no attribute 'session_id'
body: <p>I am trying to save my session_id in a variable from <code>get_report_ctx()</code>, but I get the following error:</p>
  <pre><code>AttributeError: 'NoneType' object has no attribute 'session_id'
  </code></pre>
  <p>These are the libraries of streamlit I use and the command that returns me the above error:</p>
  <pre><code>import streamlit as st
  from streamlit.report_thread import get_report_ctx
  from streamlit.server.server import Server
  import streamlit.legacy_caching.hashing
  
  SESSION_ID = get_report_ctx().session_id
  </code></pre>
  <p>My streamlit version is 1.3.1. Any help would be greatly appreciated.</p>