I think that this could be `None` instead of `False`. If that's the case, you should use:
```python
if session_id is not None:
```