Improved the session plugin.