Close the session.
The closing will execute in a normal way, finalizing the logs etc.
Session id or null = latest session