Improved session_check