Do you mean that you have evidence on the client side that the session is not closed?
Or do you want to make sure that the previous session is closed on the server side before opening a new one from the client?
Or do you mean anything else by a session that "fails to close"?