Refactor session_expired? conditions.