initialize user_id in def _load_from_cookie to prevent UnboundLocalError: local variable 'user_id' referenced before assignment