Fix bug #4612: session_shared returns diagnostic 2