Improved session and session handler