class_docstr: A SessionStorage that stores sessions in memory.
  
  At most maxsize sessions are stored with a TTL of ttl seconds. This class is really
  just a thin wrapper around cachetools.TTLCache that complies with the SessionStorage
  protocol.
docstr: Instantiate a new MemorySessionStorage.
  
  Parameters
  ----------
  maxsize
      The maximum number of sessions we allow to be stored in this
      MemorySessionStorage. If an entry needs to be removed because we have
      exceeded this number, either
        * an expired entry is removed, or
        * the least recently used entry is removed (if no entries have expired).
  
  ttl_seconds
      The time in seconds for an entry added to a MemorySessionStorage to live.
      After this amount of time has passed for a given entry, it becomes
      inaccessible and will be removed eventually.
code: def __init__(
      self,
      maxsize: int = 128,
      ttl_seconds: int = 2 * 60,  # 2 minutes
  ) -> None:
      """Instantiate a new MemorySessionStorage.
  
      Parameters
      ----------
      maxsize
          The maximum number of sessions we allow to be stored in this
          MemorySessionStorage. If an entry needs to be removed because we have
          exceeded this number, either
            * an expired entry is removed, or
            * the least recently used entry is removed (if no entries have expired).
  
      ttl_seconds
          The time in seconds for an entry added to a MemorySessionStorage to live.
          After this amount of time has passed for a given entry, it becomes
          inaccessible and will be removed eventually.
      """
  
      self._cache: MutableMapping[str, SessionInfo] = TTLCache(
          maxsize=maxsize, ttl=ttl_seconds
      )
  
file_path: streamlit/lib/streamlit/runtime/memory_session_storage.py
imports: from typing import List, MutableMapping, Optional
  from cachetools import TTLCache
  from streamlit.runtime.session_manager import SessionInfo, SessionStorage
label_desc: Use image node_id 1 to create a new MemorySessionStorage object from inherited base classes: SessionStorage with example: obj = MemorySessionStorage(maxsize, ttl_seconds)