You'll have to use a function with OnBeforeWebLogout to capture the session ID and store it. I don't see what this is going to accomplish, since the session is completely gone after logout. If you look at core/model/modx/processors/security/logout.php you'll see
$modx->user->removeSessionContext($loginContext);
if (!empty($addContexts)) {
foreach ($addContexts as $addCtx) {
$modx->user->removeSessionContext($addCtx);
}
}
Going to core/model/modx/moduser.class.php in the removeSessionContext() function you'll find
if (empty($this->sessionContexts)) {
$this->endSession();
And the endSession() function
public function endSession() {
...
$_SESSION = array();
if (ini_get("session.use_cookies")) {
$params = session_get_cookie_params();
setcookie(
session_name(),
'',
time() - 42000,
$params["path"],
$params["domain"],
$params["secure"],
$params["httponly"]
);
}
session_destroy();
}
So the session array and the cookie are both destroyed.