The current code will raise a TypeError if the session_id is None:
TypeError: 'NoneType' object has no attribute '__getitem__'
This will happen specifically when _trunc_id is called by
_is_current_session_active.
This patch adds a check to make sure session_id is not None.
Change-Id: Ifc3cc236f36df1a140b864e53e9eb538797e5580