Improved reliability and security of sessions