double negation, you can write it as session[:user_id].present?