Added session_expires check. Resolves #2344